This is for jdk1.1
In jdk1.2 CosNaming is a core class and either needs to be renamed, or, ILU needs to be on the boot class path
In jdk1.2 we recommend stubbing CosNaming with a prefix like xorg.omg so that our stubs
do not conflict with the non-ilu stubs in the core classes.
You will need to change the import lines in the application to match our re-named stubs.
Don't forget to also change the -Dilu.load=org.omg... properties into -Dilu.load=xorg.omg or whatever prefix you were using.
And of course change the -classpath in the command lines to whatever is appropriate for your Java release.
In particular, the following source files are needed
Not a single line of source code for this example is provided by the ILU distribution. (Well, change the import of org.omg.CosNaming in JDK1.2) Given my lack of skills in writing "make-files" I can not write "make-files" dealing with non-existing sources; here are the steps necessary to run this example.
java-stubber hello.idlyou will also need the CosNaming service.
javac -d classes -classpath ./classes:$ILUHOME/lib/ilu.jar:$JAVAHOME/lib/classes.zip `cat jstubber.files` helloServer.java helloClient.java
Ok, so how can that example be executed with ILU if not a line of source code is under ILU control? The following properties allow running the program within ILU for Java.
1) the -Dilu.load=... argument tells ILU for Java to load extra classes. We will use this to load the CosNaming service and the application specific stubs.
2) the -DNameService=... argument tells the orb what object to use to bootstrap the orb. (A CosNaming object)
3) the -Dorg.omg.CORBA.ORBClass=xerox.ilu.IluORB property tells the standard orb delegation to use the Ilu orb. This is of course only necessary if the standard orb delegation shells don't use Ilu by default (like the one in the jdk1.2 core).
Start the name service first, then remember the ior for the initial object. (This example shows how to start Ilu's NameService. However you could as well use any other NameService because they are compatible on the wire).
../../etc/CosNaming/ILUCosNaming -iorTo start the server side use
java -classpath ./classes:$ILUHOME/lib/ilu.jar:$JAVAHOME/lib/classes.zip -Dorg.omg.CORBA.ORBClass=xerox.ilu.IluORB -Dilu.load=org.omg.CosNaming._allJavaStubs:HelloApp._allJavaStubs -DNameService=IOR:put-the-ior-here helloServerand to start the client side use
java -classpath ./classes:$ILUHOME/lib/ilu.jar:$JAVAHOME/lib/classes.zip -Dorg.omg.CORBA.ORBClass=xerox.ilu.IluORB -Dilu.load=org.omg.CosNaming._allJavaStubs:HelloApp._allJavaStubs -DNameService=IOR:put-the-ior-here helloClientThats all...