[omniORB] Using a corbaloc URI (JacORB client, omniORB server)

yashik@veon.com yashik@veon.com
Thu Sep 5 20:08:01 2002


You can find all the answers in the docs, chapter 4.

In short, you should use the special POA for this: omniINSPOA:

Server:

     obj = orb->resolve_initial_references("omniINSPOA");
     PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
     PortableServer::POAManager_var pman = poa->the_POAManager();
     pman->activate();
     // Create object id (Always use the same one)
     PortableServer::ObjectId_var oid =
          PortableServer::string_to_ObjectId("HelloDemo");
     // Create the servant

     HelloDemoImpl* servant = new HelloDemoImpl();
     poa->activate_object_with_id(oid.in(), servant);
     servant->_remove_ref();
...


Also, you should run the server with the following command line parameters
-ORBpoa_iiop_port  <port>
where port 39537 in your case

And another thing, specify the protocol version in the URI (the default
value can be different for different ORBs):
corbaloc:iiop:1.0@myhost.mycompany.com:39537/HelloDemo

HTH,
Yakov



                                                                                                                                 
                    "Rob Eger"                                                                                                   
                    <reger@txcorp.com>                 To:     <omniorb-list@realvnc.com>,                                       
                    Sent by:                            <jacorb-developer@lists.spline.inf.fu-berlin.de>                         
                    omniorb-list-admin@omniorb-s       cc:                                                                       
                    upport.com                         Subject:     [omniORB] Using a corbaloc URI (JacORB client, omniORB       
                                                        server)                                                                  
                                                                                                                                 
                    05/09/2002 20:19                                                                                             
                                                                                                                                 
                                                                                                                                 




This seems like it should be simple, but I can't make it work.  What
I've got is a simple "hello world" type application with a JacORB client
and an omniORB server.  When I try to connect to the server using a
corbaloc I get an org.omg.CORBA.OBJECT_NOT_EXIST error.  I've tried
every possibility for the object key portion (which is where I suspect
the problem is), but nothing has worked.  Everything works fine if I use
the IOR, and also works using omniMapper.  Code snippets are below:

SERVER:

  CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
  PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(obj);

  HelloDemoImpl* di = new HelloDemoImpl();

  PortableServer::ServantBase_var servant = di;
  PortableServer::ObjectId_var diid = rootPOA->activate_object(di);

-----------------------

CLIENT:

  ORB orb = ORB.init(args, null);

  org.omg.CORBA.Object obj =
orb.string_to_object("corbaloc::myhost.mycompany.com:39537/HelloDemo");

  HelloDemo hDemo = HelloDemoHelper.narrow(obj);

-----------------------

It fails on the narrow call.  Here is the output from the server running
with traceLevel of 30:

omniORB: Server accepted connection from giop:tcp:192.168.0.111:39559
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 3
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 3
omniORB: Accepted connection from giop:tcp:192.168.0.111:39559 because
of this rule: "* unix,ssl,tcp"
omniORB: inputMessage: from giop:tcp:192.168.0.111:39559 87 bytes
4749 4f50 0100 0000 0000 004b 0000 0000 GIOP.......K....
0000 0000 0100 0000 0000 0009 4865 6c6c ............Hell
6f44 656d 6f00 0000 0000 0006 5f69 735f oDemo......._is_
6100 0000 0000 0000 0000 001b 4944 4c3a a...........IDL:
6a61 6348 656c 6c6f 2f48 656c 6c6f 4465 jacHello/HelloDe
6d6f 3a31 2e30 00                       mo:1.0.
omniORB: throw OBJECT_NOT_EXIST from GIOP_S.cc:315
(NO,OBJECT_NOT_EXIST_NoMatch)
omniORB: sendChunk: to giop:tcp:192.168.0.111:39559 76 bytes
4749 4f50 0100 0101 4000 0000 0000 0000 GIOP....@.......
0000 0000 0200 0000 2700 0000 4944 4c3a ........'...IDL:
6f6d 672e 6f72 672f 434f 5242 412f 4f42 omg.org/CORBA/OB
4a45 4354 5f4e 4f54 5f45 5849 5354 3a31 JECT_NOT_EXIST:1
2e30 0040 0100 4d4f 0100 0000           .0.@..MO....
omniORB: throw giopStream::CommFailure from
giopStream.cc:812(0,NO,COMM_FAILURE_UnMarshalArguments)


Any ideas?

Thanks,
Rob Eger
Tech-X Corporation
Boulder, CO



_______________________________________________
omniORB-list mailing list
omniORB-list@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list