Client Resolve Interface Directly, without using a naming service
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jacob_tran
Posted On:   Thursday, October 18, 2001 05:07 PM

hello, my service registers an IORAccessor interface in its IORTable with an object key. therefore i can resolve the interface directly without using a naming service using corbaloc. i would like to write the java equivalent of this c++ code: CORBA::Object_var servantObj; servantObj= orb->string_to_object( "corbaloc:hostname:9998/IORAccessor"); //servantObj resolved to something .... Service::CorbaAPI_IOR_Accessor myIORAccessor; myIORAccessor= Service::CorbaAPI_IOR_Accessor::_narrow(servantObj); i tried this in java and get an CORBA.TRANSIENT exception "co   More>>

hello,


my service registers an IORAccessor interface in its IORTable with an object key. therefore i can resolve the interface directly without using a naming service using corbaloc.





i would like to write the java equivalent of this c++ code:




CORBA::Object_var servantObj;


servantObj= orb->string_to_object( "corbaloc:hostname:9998/IORAccessor");




//servantObj resolved to something ....


Service::CorbaAPI_IOR_Accessor myIORAccessor;


myIORAccessor= Service::CorbaAPI_IOR_Accessor::_narrow(servantObj);





i tried this in java and get an CORBA.TRANSIENT exception "couldn't connect..."





java.util.Properties prop = new java.util.Properties();





prop.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");



prop.put("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");





org.omg.CORBA.ORB orb = ORB.init((String[]) null, prop);





org.omg.CORBA.Object servantObj = orb.string_to_object("corbaloc:iiop:hostname:9998/IORAccessor");





CorbaAPI_IOR_Accessor myIORAccessor = CorbaAPI_IOR_AccessorHelper.narrow(servantObj);





any ideas?





thanks,



jacob

   <<Less
About | Sitemap | Contact