Reputation: 595
I'm working from a CORBA network management spec and I want to obtain the IOR file which contains the information I need to connect to the CORBA service. There is some information about how to obtain the "ExternalNameService.ior" file from the link I posted, but I am not sure what to do. Basically I have an idea of what I want to do which is:
The part I'm stuck on is obtaining the IOR. Any ideas?
EDIT
I'm trying to provide my own implementation of a probe...not use IBM's. The article simple shows the name of the naming service, which I cannot connect to for some reason...that's my biggest problem. The following code works if I try to connect to a local name service, but fails for the ericsson one. I am providing the right ORBInitialPort
and ORBInitialHost
as command line arguments.
ORB orb = ORB.init(args, null);
String corbalocURL = "ExternalNameService";
// get the root naming context
org.omg.CORBA.Object objRef = orb.resolve_initial_references(corbalocURL);
// Use NamingContextExt instead of NamingContext. This is
// part of the Interoperable naming Service.
System.out.println(objRef);
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
System.out.println(ncRef);
These are Errors I'm getting:
ERROR : org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: 0x0 minor code: 0 completed: No
org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:374)
at java.lang.Class.newInstance(Class.java:327)
at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:914)
at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_0.getSystemException(ReplyMessage_1_0.java:111)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:590)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:459)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:355)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:147)
at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:114)
at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.list(BootstrapResolverImpl.java:151)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:55)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:55)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:55)
at com.sun.corba.se.impl.orb.ORBImpl.list_initial_services(ORBImpl.java:1143)
at HelloClient.main(HelloClient.java:22)
Upvotes: 1
Views: 3569
Reputation: 19295
You should never do #2. CORBA was designed to hide network details from you. Plus, IORs are not always bound to TCP/IP and therefore might not even contain a host or port (although they almost always do).
I'd recommend learning a little more about CORBA before going much further. This is a good intro site.
IORs are the "handles" to your server objects, and are meant to be opaque blobs of data that you just use to call the remote resources to which they refer. They're like phone numbers for people - a means to enable communication.
If you don't have an IOR string in a file somewhere, you might be able to find the IOR in a Naming Service running somewhere (it's like a "White Pages" directory for IORs).
Upvotes: 2