|
From: Lev, E. <EL...@ng...> - 2005-04-15 01:14:49
|
Leif, Thank you for explaining this. Eli >-----Original Message----- >From: wra...@li... >[mailto:wra...@li...]On Behalf Of Leif >Mortenson >Sent: Monday, April 11, 2005 5:56 PM >To: wra...@li... >Subject: Re: [Wrapper-user] Is there a way to user windows system >variables in wrapper.conf file? > > >Eli, > The Wrapper's configuration file is able to expand system=20 >environment variables >referenced in the configuration file. You can do so just as=20 >you mentioned: > >wrapper.java.additional.1=3D-Djava.rmi.server.hostname=3D%COMPUTERNAME% > > If the COMPUTERNAME environment variable is not defined=20 >then the string >will not be replaced. > > The replacement syntax is the same of all platforms to make it=20 >possible to reuse >the same configuration file across all platforms. > >wrapper.java.command=3D%JAVA_HOME%\bin\java > > Note that it is not possible to read environment variables from=20 >within a JVM. >To make an environment variable visible to the JVM you must=20 >pass it in as a >system property: >wrapper.java.additional.2=3D-Denv.MYENV=3D%MYENV% > > You then access it by calling System.getProperty( "env.MYENV" ); > >This is all described in the docs here: >http://wrapper.tanukisoftware.org/doc/english/props-envvars.html > >Cheers, >Leif > >Lev, Eli wrote: > >>Hi, >> >>I'm using the simple wrapper way of doing things. One issue=20 >that I'm hitting is that one of the parameters that I need to=20 >feed the java app is the hostname of the machine where the app=20 >is running. So in the original dos bat that would launche tha=20 >app it's: >> >>start java -Djava.rmi.server.hostname%COMPUTERNAME%... >> >>So %COMPUTERNAME% is a system wide environment variable for=20 >windows that tells you the host that you're on (similar to=20 >unix's hostname command). >> >>In the wrapper.conf, I have the following: >> >>wrapper.java.additional.1=3D-Djava.rmi.server.hostname=3D??? >> >>For the ??? - I place the hostname of the machine that I'm on=20 >and the service works fine. Can I put %COMPUTERNAME% for the=20 >wrapper.conf? In other words: >>wrapper.java.additional.1=3D-Djava.rmi.server.hostname=3D%COMPUTERNAME%= =20 >> >>Localhost is not an option in this case, and the problem is=20 >that this program will be installed on many different=20 >machines, so I'm trying to find a way of avoiding a dynamic=20 >creation of wrapper.conf during install. >> >>I'd appreciate any advice/feedback. >> >>Eli >> =20 >> > > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from=20 >real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick >_______________________________________________ >Wrapper-user mailing list >Wra...@li... >https://lists.sourceforge.net/lists/listinfo/wrapper-user > |