|
From: <zge...@ex...> - 2004-05-28 16:27:28
|
Leif, Thanks for the response. My first attempt at this was to try the approach you recommend below (in fact that's the approach I took with the java Name Service which worked). I did not have much success with it for rmid. However, I did NOT also set the policy file to give specific permissions to the wrapper jar. Wrapper jar was bundled into my codebase jar file. I'll try the route you suggest once again. The second issue with the approach you suggest was that I could not find a way to pass the "-C" command line options that I can typically pass on the command line to rmid.exe for passing on to child JVMs if I call on the sun implemenation directly. Even if there is a way around the above two issues, I believe there may still be a third issue - the rmid daemon will activate JVMs for activatable objects. I need those JVMs to survive login/logouts. The launch sequence is as follows: wrapper.exe->rmid.exe->java.exe (contains activatable object). Since wrapper does not own these "sub" processes they clearly will not survive the login/logout. What would have been ideal was for a parent process to own the child process. THe child process may choose to exit on its own - if it did not make that choice, then the parent process must control its life cycle. Again, thanks for your response. -- Zac > Message: 8 > Date: Wed, 26 May 2004 16:32:33 +0900 > From: Leif Mortenson <le...@ta...> > To: wra...@li... > Subject: Re: [Wrapper-user] Converting RMID into a NT/2000 service > Reply-To: wra...@li... > > 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. >> >> _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web! |