Launching Application Clients
Written by Joseph Ottinger
This was contributed via the orion-interest mailing list...
Previously I was doing something basic like this to launch my application clients:
java -jar \\ %ORION_HOME%\orion.jar;%ORION_HOME%\;%ORION_HOME%/lib/log4j.jar;myapp-client.jar \\ com.acme.MyAppClient
And I had a jndi.properties in the same directory which specified how to connect to Orion. This is clunky and requires that you distribute all your jar files to the machine you wish to run it on. Yuck. Then, I "discovered" applicationlauncher.jar (it's not exactly hidden, it's in the Orion dir :-). This lets you launch application clients locally, even if they are installed on remote systems. It's seemingly like an Orion version of java web start. To use it, you need to ensure that your application client is deployed properly in a J2EE sense. For me, all I had to do was:
* add a <module> and <java> tags to my application.xml like so:
<module>
<java>myapp-client.jar</java>
</module>
* copy my shared libraries into a lib dir inside my .ear file
* add a manifest for myapp-client.jar with the main class and any shared libraries like so:
Manifest-Version: 1.0
Main-Class: com.acme.MyAppClient
Class-Path: lib/log4j.jar
Now, I can launch the application client by issuing the command:
java -jar c:\apps\orion\154\applicationlauncher.jar \ ormi://localhost/myapp/mayapp-client.jar <user> <password>
This is cool because I don't have to mess about with the classpath or jndi.properties at launch time, presumably I could launch it on a remote machine if I wanted with similar ease (!). Presumably all you would need on the remote machine would be applicationlauncher.jar and orion.jar (rather than all your applications jar files), but I've not tested it...
Copyright © 2007 IronFlare AB