简体   繁体   中英

How to obtain a CORBA IOR

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:

  1. Obtain the IOR.
  2. Decode it so that I get the IP and Port of the CORBA service.
  3. Compile the IDLs and use them to connect to the remote resources.

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)

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM