|
From: Leif M. <le...@ta...> - 2004-05-26 07:32:37
|
Zac, All I can say is ouch! You must like pain! There is a much easier way to do this. (Not that sun makes it easy to find out about) The rmid.exe file is actually simply running a sun class. To get things running under the Wrapper, you will need to do the follow. This assumes that you have read over method #1 of the integration documentation. http://wrapper.tanukisoftware.org/doc/english/integrate.html First, the Wrapper classes will be calling RMI daemon code on startup so you will need to give privilege to them. Create a file called. rmiserver.policy in your conf directory with the following contents. --- // Give Wrapper classes full permissions grant codeBase "file:../lib/wrapper.jar" { permission java.security.AllPermission; }; --- Now you will need to set the following properties in your wrapper.conf file. Copy it over from the src/conf/wrapper.conf.in file that ships with the Wrapper. --- wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp wrapper.java.classpath.1=../lib/wrapper.jar wrapper.java.additional.1=-Djava.security.policy=../conf/rmiserver.policy wrapper.app.parameter.1=sun.rmi.registry.RegistryImpl --- You will also want to set the NT properties at the bottom of the file. Everything should now work for you. Give it a try as a console before trying to get things working as an NT service. Let me know if I have any typos in the above. As for your questions about the Wrapper protecting child JVMs from system signals. The answer is no. You must launch the child JVMs with the -Xrs parameter so it will ignore them on its own. You can not set this for the JVM launched by the Wrapper however or you WILL run into problems. The Wrapper protects its own JVM already so this should never be necessary. Cheers, Leif zge...@ex... wrote: >I need to convert the Java RMID process into a windows service. > > > >Using integration method 3 I did the following: > >1) Create a WrapperListener implementation that uses java.lang.Runtime.exec(...) to launch "rmid.exe". The implementation's "stop" method similarly launches "rmid.exe -stop" to stop the previously launched rmid process. > >2) Install the WrapperListener implementation as an NT service. > > > >On installing the service and starting it and after > >activating a remote object in a separate Activatable Server (that rmid process takes care of launching), I see the following processes (among others) in the "Windows Task Manager". > >#a) wrapper.exe > >#b) java.exe (the WrapperListener implemenation) > >#c) rmid.exe (launched by #b) > >#d) java.exe (activated by rmid.exe in #c). > > > >On stopping the service all of these processes come down cleanly. > > > >Here's the problem: > >After launching the service - if I logoff, rmid.exe (#c) and the java.exe (#d) process seem to shutdown. When I login again, all four processes are gone. > > > >In the WrapperListener implementation I do get the Service Control Event indicating that a logoff has happened - The current behavior is to let the native WrapperManager handle all service control events. > > > >Are processes launched from the WrapperListener implementation under the control of the service - i.e. live and die with the life of the service? > > > >Has anyone successfully implemented rmid as a service (especially including its activation features) not just as a registry? > > > >Can JSW be used for a case like this to first launch rmid.exe which can then internally launch multiple JVMs that can survive login/logoffs. > > > >Thanks for all your help in advance. > >Zac George > > |