facing challenges while connecting JAVA CORBA client to C++ CORBA Server.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Amar_Nath
Posted On:   Tuesday, November 15, 2005 04:42 AM

I have a CORBA server written in C++. It registers its services in Naming_Service of TAO ORB. This server and Naming_Service is running on Linux Machine say m1. Now I have written the Java client which tries to contact this server. Note that Client is situated in different Linux machine say m2. At the Client side I am doing like --- clip --- Properties props = new Properties(); props.put("org.omg.CORBA.ORBInitialPort", "xxxx"); props.put("org.omg.CORBA.ORBInitialHost", "xxx.xxx.xxx.xxx"); org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,props); org.omg.CORBA.Object rootObj = orb.resolve_initial_references("NameService");   More>>

I have a CORBA server written in C++. It registers its services in Naming_Service of TAO ORB. This server and Naming_Service is running on Linux Machine say m1.

Now I have written the Java client which tries to contact this server. Note that Client is situated in different Linux machine say m2.

At the Client side I am doing like
--- clip ---
Properties props = new Properties();

props.put("org.omg.CORBA.ORBInitialPort", "xxxx");

props.put("org.omg.CORBA.ORBInitialHost", "xxx.xxx.xxx.xxx");

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

org.omg.CORBA.Object rootObj = orb.resolve_initial_references("NameService");

NamingContextExt RC = NamingContextExtHelper.narrow(rootObj);
-------------clip ---------

I am Running the client like:

% java Samplejavaclient -ORBInitRef NameService=corbaloc:iiop: : /Naming_Service

NOTE: orbd is running at the client side with the port xxxx. (Same as mentioned in the client code)

But I get Error while Resolving the Name contexts. Resolution of Initial Root Context is successful.

Below is the snippet of ERROR message I got

-------clip ------
Before resolving
Not Foundorg.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
Ends ...

-------clip -------

Can you please help me

Regards

   <<Less

Re: facing challenges while connecting JAVA CORBA client to C++ CORBA Server.

Posted By:   Anonymous  
Posted On:   Monday, November 21, 2005 10:16 PM

First, definitely check out the TAO mailing list and if that fails, comp.object.corba.

Also it seems there is some overlap in your code - you have "NameService" in the resolve_initial_references call, but you are also sending as a command-line arg, that is probably not what you want. You could send the host and port as command line args instead, and then you wouldn't have those hardcoded in the program, and your connecting to the name service in a consistent way.
About | Sitemap | Contact