Thanks for the reply Mark , however i am still unable to access the object. My java code is<br>
<br>
<span style="color:rgb(0,0,102)">Properties props = new Properties();</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
props.put("org.omg.CORBA.ORBInitRef", "NameService=corbaname::XPA::2809");</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
ORB orb = ORB.init((String[])null, props);</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
// get the root naming context and obtain its address</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
String names[] = orb.list_initial_services();</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
NamingContextExt ncRef ;</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
ncRef = NamingContextExtHelper.narrow(objRef);</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
//Location of object in naming service </span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
NamingContext rootContext = null;</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
NameComponent nc[] = new NameComponent[1];</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
nc[0]=new NameComponent("obj","obj");</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
org.omg.CORBA.Object myobj = rootContext.resolve(nc); // return null and breaks</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
//-----------------------------------------------------------------------------</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">
TestIntImpl = TestIntHelper.narrow(myobj); //If the object had been located</span><br>
<br><b>My C++ Server code is:</b><br><br>
CosNaming::NamingContextExt_
<div id=":69">var rootContext;<br> // Obtain a reference to the root context of the Name service:<br>
CORBA::Object_var obj;<br>obj = orb->resolve_initial_references("NameService");<br>rootContext = CosNaming::NamingContextExt::_narrow(obj);<br> <br> //Create a name called contextName<br> CosNaming::Name contextName;<br>
contextName.length(1);<br> contextName[0].id = (const char*) "obj"; <br> contextName[0].kind = (const char*) "obj"; <br> <br> // Bind the context to root.<br>
rootContext->bind(contextName,objref); //objRef is an address to the object that needs to be send<br><br>could u spot any faults ?? or any suggestions on how to resolve this issue ??<br><br></div>
<div class="gmail_quote">On Thu, Dec 29, 2011 at 11:05 AM, Mark Zimmerman <span dir="ltr"><<a href="mailto:markzimm@frii.com" target="_blank">markzimm@frii.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Thu, Dec 29, 2011 at 06:41:02AM -0700, Rajesh Khan wrote:<br>
> Hi i am trying to get my java client to communicate with the C++ omniORB<br>
> server. I wanted to know is there a way to specify the naming service<br>
> address in java.<br>
> Like for example in C++ client we specify a config file having the<br>
> parameter:<br>
</div>> *InitRef = NameService=corbaname::RemoteComputerName:2809/NameService*<br>
<div>> I wanted to know what would its equivalent be in java.<br>
</div>> I am only familiar with*<br>
> org.omg.CORBA.Object objRef = orb.resolve_initial_references()*<br>
<div>><br>
> and tnameserv.exe which starts the java based naming server<br>
<br>
</div>In the Properties object you pass to org.omg.CORBA.ORB.init, set this<br>
property:<br>
<br>
"org.omg.CORBA.ORBInitRef"<br>
<br>
to<br>
<br>
"NameService=corbaname::RemoteComputerName::2809"<br>
<br>
Or, use a command line argument.<br>
<br>
</blockquote></div><br>