[omniORB] OmniORB to Java

Jonathan Buchanan buchanan@olsen.ch
Tue, 13 Jun 2000 08:18:54 +0200


> I try to connect a C++ based server application with a java1.3 based client
> program.
> How can I tell the java program to use the OmniORB name service ?
>

If you initialise the ORB with properties ORBInitialHost and
ORBInitialPort then this works fine (under Java 1.2 at least):


    NamingContext result = null;
    org.omg.CORBA.Object obj =
        orb_.resolve_initial_references( "NameService" );
    if ( obj != null ) {
        result = NamingContextHelper.narrow( obj );
    }

Probably a good idea to put this inside a try block though.

Jon