[omniORB] omniORB2 / Java ORB interoperability study

Herve Lehoux hlehoux@ADWAYS.com
Tue, 18 May 1999 08:57:46 +0100


> Here is a study I've made about interoperability between omniORB2 and
> some other Java ORB, the goal was to find a suitable Java ORB for
> developping some extensions to our omniORB2 C++ product.
> 
> This is yet a draft.
> 
> Any comment welcomed.
>

Your study is very interesting. i've a few comments though.

About the JavaSoft ORB in jdk1.2 : i agree that their idl compiler is a
nightmare; you have to modify your idl files a lot to make them
understandable by the cmpiler and sometimes you cannot. However, i was
able Share the omniORB Naming Service :

the following code works perfect for an applet :

		// Initialize ORB.
		java.util.Properties props = new java.util.Properties();
		props.put("org.omg.CORBA.ORBInitialHost", "maestro");
		props.put("org.omg.CORBA.ORBInitialPort", "14000");

		org.omg.CORBA.ORB orb =
org.omg.CORBA.ORB.init(this,props);

		System.err.println("Searching For the NamingService");

		try {
		    object =
orb.resolve_initial_references("NameService");
		}
		catch ( org.omg.CORBA.ORBPackage.InvalidName e) {

System.err.println("org.omg.CORBA.ORBPackage.InvalidName");
		}

		System.err.println("NamingService Found");

		NamingContext root = NamingContextHelper.narrow(object);

		NameComponent dspname[] = { ../.. your naming scheme
		};

		System.err.println("Resolving...");

		try {
		    object = root.resolve(dspname);
		}
		catch (org.omg.CosNaming.NamingContextPackage.NotFound
e) {
		    System.err.println("NotFound");
		}
		catch
(org.omg.CosNaming.NamingContextPackage.CannotProceed e) {
		    System.err.println("CannotProceed");
		}
		catch
(org.omg.CosNaming.NamingContextPackage.InvalidName e) {
		    System.err.println("InvalidName");
		}

		System.err.println("Dispatcher Name resolved");

		dsp = Base.DispatcherHelper.narrow(object); 

		.../....

In the contrary, it's not that easy the Share the omniORB Naming Service
with visibroker for java (3.3) because vbj AFAIK does not use the same
bootstrap protocol as javasoft and omniORB; indeed,
resolve_initial_reference("NameService") does not work. You have to pass
the IOR of your Naming Service and narrow it to thje right class.
correct me if you found a way to bootstrap a vbj client with omniORB
Naming Service.

Rgds, Herve.