commons-user mailing list archives

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

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:

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

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
                             at javax.naming.InitialContext.getDefaultInitCtx(Unknown
                             at javax.naming.InitialContext.init(Unknown
                             at javax.naming.InitialContext.<init>(Unknown
                             at com.systematic.ins.sesthesaurusimporter.jms.impl.JMSQueueReceiverImpl.getInitialContext(
                             at com.systematic.ins.sesthesaurusimporter.jms.impl.JMSQueueReceiverImpl.<init>(
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.getJMSQueueReceiver(
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.getXMLMessages(
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.startImporter(
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.start(
                             at com.systematic.ins.sesthesaurusimporter.SESThesaurusImporter.startService(
Caused by: java.lang.ClassNotFoundException: weblogic/jndi/WLInitialContextFactory
                             at java.lang.Class.forName0(Native
                             at java.lang.Class.forName(Unknown
                             at com.sun.naming.internal.VersionHelper12.loadClass(Unknown
                             ... 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:
For additional commands, e-mail:

View raw message