本文介绍了jacorb中的InvalidName异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Jacorb进行corba实施.我已经在端口900上启动了NS.当我尝试启动服务器时,出现以下异常

I am using Jacorb for corba implementation. I have started the NS on port 900.When I am trying to start the server I am getting following exception

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

}

有人可以告诉我这里出什么问题吗?

Could someone tell whats the problem here?

推荐答案

NameService引用必须是对包含IOR的文件的引用,例如 file://tmp/NS_Ref 或URL,例如 http://www.testme.not/NS_Ref 或仅仅是corbaloc/corbaname URL,例如 corbaloc:iiop:1.2@host1:3075/NameService

The NameService reference has to be either a reference to a file containing an IOR, e.g., file://tmp/NS_Ref or an URL, e.g., http://www.testme.not/NS_Ref or just a corbaloc/corbaname URL, e.g., corbaloc:iiop:1.2@host1:3075/NameService

最后一个是最常见的.您可以将其缩短为例如 corbaloc :: localhost:900/NameService

The last one is most common. You can shorten it, for example, to corbaloc::localhost:900/NameService

有关corbaloc的更多信息,请访问 http://www.ciaranmchale.com/corba-explained-simply/the-corbaloc-and-corbaname-urls.html

More information to corbaloc could be found at http://www.ciaranmchale.com/corba-explained-simply/the-corbaloc-and-corbaname-urls.html

这篇关于jacorb中的InvalidName异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 17:41