commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Krogh Neigaard <Soeren.Krogh.Neiga...@systematic.com>
Subject PLEASE HELP: classnotfounderror when running as Procrun service?
Date Fri, 05 Mar 2010 09:39:51 GMT
Hi

I am trying to bump me message, I really need help.

I am trying to use Procrun to run me Java app as a service:

http://commons.apache.org/daemon/procrun.html

I am installing my service with this command:

prunsrv.exe //IS//SESThesaurusImporter --Install=%path_to_base_dir%\bin\ prunsrv.exe --Description="My
Service" --Classpath=%path_to_base_dir%\lib\jms-1.1.jar;%path_to_base_dir%\lib\my-service.jar;%path_to_base_dir%\lib\log4j-1.2.15.jar;%path_to_base_dir%\lib\wlfullclient-10.3.jar;%path_to_base_dir%\config
--StartMode=jvm --StartClass=com.myservice.MyService --StartMethod=startService --StartParams=%path_to_base_dir%
--StopMode=jvm --StopClass= com.myservice.MyService --StopMethod=stopService --StopParams=stop
--LogPath=%path_to_base_dir%\logs --StdOutput=auto --StdError=auto --Startup auto --JavaHome
%java_home%

Whenever I start my service, I get the following error:

javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
[Root exception is java.lang.ClassNotFoundException: weblogic/jndi/WLInitialContextFactory]
                             at javax.naming.spi.NamingManager.getInitialContext(Unknown
Source)
                             at javax.naming.InitialContext.getDefaultInitCtx(Unknown
Source)
                             at javax.naming.InitialContext.init(Unknown
Source)
                             at javax.naming.InitialContext.<init>(Unknown
Source)
                             at com.systematic.ins.sesthesaurusimporter.jms.impl.JMSQueueReceiverImpl.getInitialContext(JMSQueueReceiverImpl.java:58)
                             at com.systematic.ins.sesthesaurusimporter.jms.impl.JMSQueueReceiverImpl.<init>(JMSQueueReceiverImpl.java:30)
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.getJMSQueueReceiver(SESThesaurusImporter.java:139)
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.getXMLMessages(SESThesaurusImporter.java:145)
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.startImporter(SESThesaurusImporter.java:100)
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.start(SESThesaurusImporter.java:86)
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.startService(SESThesaurusImporter.java:57)
Caused by: java.lang.ClassNotFoundException: weblogic/jndi/WLInitialContextFactory
                             at java.lang.Class.forName0(Native
Method)
                             at java.lang.Class.forName(Unknown
Source)
                             at com.sun.naming.internal.VersionHelper12.loadClass(Unknown
Source)
                             ... 11 more

The weblogic.jndi.WLInitialContextFactory class is in the wlfullclient-10.3.jar, and if I
do a Class.forName("weblogic.jndi.WLInitialContextFactory") I get no errors, so I can load
this class, but when new InitialContext() is executed it fails to load this class.

I then try and run this via the commandprompt and via a main method, and then it all works
just fine. I also tried to do a System.out.println(System.getProperty("java.class.path"));
both when running as service and when running from the command prompt. And it gives me the
exact same classpath.

Any ideas what the hell is wrong here? Somehow there is a difference from me running Java
from the command prompt, and from Procrun running Java as a service, can I somehow remove
this difference so that it runs as done from the commandprompt?

Med venlig hilsen / Kind regards 
Søren Krogh Neigaard

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message