I have java services running within IceBox. These services read system properties and act on it. I am on windoze !
When IceBox is started in standalone mode I pass the system properties either by setting them explicitly in the environment or via -D in the java command line.
I would like to deploy the same services running within java IceBox in IceGrid and need to pass the same system properties.
I have tried following and would appreciate your help / input to achieve the best solution.
Also, in the following cases ONLY case 3 works for me and values for environment variables are not set in case 1 and case 2. I really dont want to hard code the values in the xml file. (I have tried setting the system environment properties)
Thanks for your help in advance
Case 1
Case 2Code:<icegrid> <application name="DevIceBox"> <node name="localhost"> <icebox id="DevIceBox" exe="java" activation="on-demand"> <option>-DAPP_FILE=%APP_FILE%</option> <option>-DENV_FILE=%ENV_FILE%</option> <option>IceBox.Server</option> <service name="MyService" entry="com.xxx.myservice"> <adapter name="${service}" endpoints="tcp -p 10010" register-process="true"/> </service> </icebox> </node> </application> </icegrid>
Case 3Code:<icegrid> <application name="DevIceBox"> <node name="localhost"> <icebox id="DevIceBox" exe="java" activation="on-demand"> <env>APP_FILE=%APP_FILE%</env> <env>ENV_FILE=%ENV_FILE%</env> <option>IceBox.Server</option> <service name="MyService" entry="com.xxx.myservice"> <adapter name="${service}" endpoints="tcp -p 10010" register-process="true"/> </service> </icebox> </node> </application> </icegrid>
Code:<icegrid> <application name="DevIceBox"> <node name="localhost"> <icebox id="DevIceBox" exe="java" activation="on-demand"> <option>-DAPP_FILE=c:\config\config.xml</option> <option>-DENV_FILE=c:\config\dev.properties</option> <option>IceBox.Server</option> <service name="MyService" entry="com.xxx.myservice"> <adapter name="${service}" endpoints="tcp -p 10010" register-process="true"/> </service> </icebox> </node> </application> </icegrid>

Reply With Quote