Hi, first thank you so much for this amazing project, you guys rock!
I'm having a weird problem creating a service. I've used WinRun4j successfully before, but for some reason for this particular collection of jar files I'm using, I get an error in my log file when the service is started:
[info] Module Name: C:\myapp\bin\myapp.exe
[info] Module INI: C:\myapp\bin\myapp.ini
[info] Module Dir: C:\myapp\bin\
[info] INI Dir: C:\myapp\bin\
[info] Found VM: C:\Program Files\Java\jre6\bin\client\jvm.dll
[info] Expanding Classpath: C:\myapp\lib\*.jar
[info] Expanding Classpath: C:\myapp\lib/derby.jar
[info] Expanding Classpath: C:\myapp\lib/derbynet.jar
[info] Expanding Classpath: C:\myapp\lib/derbytools.jar
[info] Expanding Classpath: C:\myapp\lib/jetty-6.1.15.jar
[info] Expanding Classpath: C:\myapp\lib/jetty-util-6.1.15.jar
[info] Expanding Classpath: C:\myapp\lib/myapp-launch.jar
[info] Expanding Classpath: C:\myapp\lib/servlet-api-2.5-20081211.jar
[info] Expanding Classpath: C:\myapp\lib/WinRun4J.jar
[info] Generated Classpath: C:\myapp\lib\derby.jar;C:\myapp\lib\derbynet.jar;C:\myapp\lib\derbytools.jar;C:\myapp\lib\jetty-6.1.15.jar;C:\myapp\lib\jetty-util-6.1.15.jar;C:\myapp\lib\myapp-launch.jar;C:\myapp\lib\servlet-api-2.5-20081211.jar;C:
[info] VM Args:
[info] vmarg.0=-DmyappHomeDir=C:\myapp
[info] vmarg.1=-Djava.class.path=C:\myapp\lib\derby.jar;C:\myapp\lib\derbynet.jar;C:\myapp\lib\derbytools.jar;C:\myapp\lib\jetty-6.1.15.jar;C:\myapp\lib\jetty-util-6.1.15.jar;C:\myapp\lib\myapp-launch.jar;C:\myapp\lib\servlet-api-2
[info] vmarg.2=-Xmx1000m
[info] Main Class: myapp/enterprise/myappEnterprise
[info] Registering natives for Log class
[info] Registering natives for INI class
[info] Registering natives for SplashScreen class
[info] Registering natives for Registry class
[info] Registering natives for Shell class
[info] Registering natives for EventLog class
[err] Could not find control method class
java.lang.NoSuchMethodError: serviceRequest
The ini file is:
classpath.1=c:\myapp\lib\*.jar
vm.version.min=1.5
vm.heapsize.preferred=1000
log=c:\myapp\logs\stdout.log
log.overwrite=true
single.instance=process
service.class=myapp.MyApp
service.name=myapp
service.description=myapp
vmarg.1=-DmyappHomeDir=f:\myapp
Now if I change nothing except for deleting jetty-util-6.1.15.jar, then I get the following error instead:
[info] Registering natives for Log class
[info] Registering natives for INI class
[info] Registering natives for SplashScreen class
[info] Registering natives for Registry class
[info] Registering natives for Shell class
[info] Registering natives for EventLog class
[err] Could not find service class
java.lang.NoClassDefFoundError: org/mortbay/component/LifeCycle
Any idea what on earth is going on?
I'm using a renamed WinRun4Jc.exe as myapp.exe, and have no other files from the win4j package in my installation directory.
Any ideas? thanks so so much for any help!
Hi,
From the log output it looks to me like your service class depends on org/mortbay/component/LifeCycle, which isn't being included in the classpath. Can you check that you have this class in one of the jars you are including?
Thanks,
Peter