|
From: <did...@vo...> - 2005-04-04 07:17:07
|
I identifed the origin of my problem and was able to solve it. Here is my solution : The problem was that JWS started a second JVM to run my application. I finally found out that JWS don't always do this. It first try to find out if the current JVM is suitable for the application, and then decide if the application needs a second JVM instance. To see if the current JVM is suitable, JWS compares things such as the heap size, the path to the javaw.exe command, and so on. In my case the path was different : the command path used by the wrapper was "C:\Program Files\Java\j2re1.4.2_04\bin" and the 1.4 JRE defined in JWS was in "C:\bin\j2sdk1.4.2_04\bin". I only changed the wrapper's javax.exe path and my problem was solved : - I start the Windiws NT service - it launches my application and updates it - the same JVM then runs my application => the windows service is no more considered as stopped Thanks to Leif Mortenson for his suggestion to figure out the command generated by JWS to launch that second JVM Didier D > De : "did...@vo..." > > Hi, > > I'm using the Java Service Wrapper to launch a Java Web Start application as a NT Service (W2000). To do so, I followed the instructions given here : > > > My application runs fine, but in the Service Panel, my service is showed as 'not running'. > I investigated a bit and found out that : > - the wrapper launches a JVM for JWS > - JWS launches another JVM for my application > - the JWS JVM ends normally and my application still runs fine > - the wrapper ends and the service is showed as 'not running' > - my application is still running as a 'javaw.exe' process in the windows task manager. > > The fact that the service is not showed as 'running' is confusing. The admin may want to start my application again and again. > So, is there a way to avoid this behavior? > > To illustrate this, here is the output for a console execution : > > C:\bin\wrapper>Wrapper.exe -c wrapper.conf > wrapper | --> Wrapper Started as Console > wrapper | Using system timer. > wrapperp | server listening on port 1777. > wrapper | Launching a JVM... > wrapper | command: "C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe" -Djnlpx.deployment.system.home="C:\WINNT\Sun\Java\Deployment" -Djnlpx.heapsize=NULL,NULL -DtrustProxy?=true -Djnlpx.deployment.user.home="C:\Documents and Settings\dduquennoy\Application Data\Sun\Java\Deployment" -Djnlpx.jvm="C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe" -Djava.security.policy="file:/C:\batch/wrapper.policy" -Djnlpx.home="C:\Program Files\Java\j2re1.4.2_04\javaws" -Dwrapper.home="C:\batch" -Djnlpx.remove=false -Djnlpx.offline=true -Xms15m -Xmx15m -Djava.library.path="." -classpath "wrapper.jar;C:\Program Files\Java\j2re1.4.2_04\javaws\javaws.jar;C:\Program Files\Java\j2re1.4.2_04\javaws\javaws-l10n.jar" -Dwrapper.key="IQDTkRUQsJMB39d5" -Dwrapper.port=1777 -Dwrapper.debug="TRUE" -Dwrapper.use_system_time="TRUE" -Dwrapper.version="3.1.2" -Dwrapper.native_library="wrapper" -Dwrapper.cpu.timeout="10" > -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp com.sun.javaws.Main http://JWSServ/JWSProvider/myApp.jnlp > wrapper | JVM started (PID=1692) > jvm 1 | WrapperManager class initialized by thread: main Using classloader: sun.misc.Launcher$AppClassLoader@1ff5ea7 [...] > wrapper | JVM process exited with a code of 0, leaving the wrapper exit code set to 0. > wrapper | JVM exited normally. > wrapper | <-- Wrapper Stopped > > C:\bin\wrapper> > > Any hint welcome, > > Didier D ------------------------------------------ Faites un voeu et puis Voila ! www.voila.fr |