[omniORB] OmniORB and JAVAorb, trying to use corbaloc

Antoine Thierry athierry@alphacent.com
Mon, 6 May 2002 16:10:41 +0200


i develop a clientserver app
Server : C++ OmniORB 3.04 , Linux
Client : Java JAVAORB (JDK 1.4), Linux

We want to make a sort of IOR distributor, as saw in the list a few time ago.

so, i init the ORB with as command line argument 
-ORBpoa_iiop_name_port <myhost>:<myport>

i create my main POA with 
CORBA::Object_var obj = orb->resolve_initial_references("omniINSPOA");
PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(obj);

when i make a test with my small omniORB/c++ client, giving to it
- the same parameter on the command line :
( -ORBpoa_iiop_name_port <myhost>:<myport> )

then, i'll do this

string ior_netpath = "corbaloc:iiop:" + <myhost> + ":" + <myport> + 
"/MyrdvSessionManager";
CORBA::Object_var net_object = orb->string_to_object(ior_netpath.c_str());

and then .. everything functions well


But, when i want to do the same with the JAVA client
i'll get an error of omniORB, which is the following

omniORB: scavenger : scanning connections
omniORB: tcpSocketMTfactory Rendezvouser: unblock from accept()
omniORB: tcpSocketMTfactory Rendezvouser: accept new strand.
omniORB: tcpSocketMTfactory Worker: start.
connect from <clientip>
omniORB: tcpSocketMTfactory Rendezvouser: block on accept()
omniORB: throw omniConnectionBroken (minor 0) from giopServer.cc:400
omniORB: tcpSocketMTfactory Worker: #### Connection closed.
omniORB: tcpSocketMTfactory Worker: exit.
omniORB: tcpSocketStrand::~Strand() close socket no. 8

i've made a small java test program which is the following : 

/package Myrdv;
import java.io.*;
import java.util.*;
import org.omg.CORBA.*;
import org.omg.CosNaming.*;
import Myrdv.*;

class corbaTest
{
    public static void main (String[] arguments) throws
AuthFailed,PermDenied,Myrdv.Error,Exception
    {
        Properties p=System.getProperties();
        p.put("org.omg.CORBA.ORBInitialHost","<my_server_ip>");
        p.put("org.omg.CORBA.ORBInitialPort","<my_server_port>");
        org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(arguments,p);

        String nameService = 
"corbaloc:iiop:<my_server_ip>:<my_server_port>/MyrdvSessionManager";

(MyrdvSessionManager is the corba key of the object i want to get)

        System.out.println("Connection : " + orb);
        SessionManager manager =
SessionManagerHelper.narrow(orb.string_to_object(nameService));
    }
}

when i execute this program, it make bugs when the narrow() is called ..

Any Idea ?

Thanks in advance

Antoine Thierry