我正在使用Jacorb来实现corba。我已经在端口900上启动了NS。当我尝试启动服务器时,我得到了以下异常
D:\eclipse_workspace\WorkSpace\corba\bin>jaco hello.MyServer -DORBInitRef.NameService=jacorb::localhost:900
org.jacorb.orb.ORB
Feb 14, 2013 4:00:07 PM org.jacorb.config.JacORBConfiguration <init>
WARNING: no properties found for configuration jacorb
Feb 14, 2013 4:00:07 PM org.jacorb.orb.ORBSingleton <init>
INFO: created ORBSingleton
Exception in thread "main" org.omg.CORBA.ORBPackage.InvalidName: IDL:omg.org/CORBA/ORB/InvalidName:1.0
at org.jacorb.orb.ORB.resolve_initial_references(ORB.java:1371)
at hello.MyServer.main(MyServer.java:15)public static void main(String[] args) throws Exception{
Properties props = new Properties();
props.setProperty("ORBInitRef","NameService=jacorb::localhost:900");
System.out.println(System.getProperty("org.omg.CORBA.ORBClass"));
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, props);
org.omg.CORBA.Object o = orb.resolve_initial_references("NameService");
NamingContextExt nc = NamingContextExtHelper.narrow( o );
}发布于 2013-02-16 05:34:01
NameService引用必须是对包含IOR的文件的引用,例如file://tmp/NS_Ref或URL,例如http://www.testme.not/NS_Ref,或者仅仅是corbaloc/corbaname URL,例如corbaloc:iiop:1.2@host1:3075/NameService
最后一个是最常见的。您可以将其缩短,例如,缩短为corbaloc::localhost:900/NameService
欲了解更多有关corbaloc的信息,请访问http://www.ciaranmchale.com/corba-explained-simply/the-corbaloc-and-corbaname-urls.html。
https://stackoverflow.com/questions/14872811
复制相似问题