2013-02-14 29 views
1

我正在使用Jacorb進行corba實現。當我試圖啓動服務器,我收到以下異常jacorb中的無效名稱異常

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

} 

有人能告訴什麼問題在這裏,我已經開始在端口900 的NS?

+1

發現我從來沒有見過一個CORBA網址與jacorb前綴:'-DORBInitRef .NameService = jacorb :: localhost:900'您是否嘗試將其更改爲corbaloc url:'-DORBInitRef.NameService = corbaloc :: localhost:900'? – display101 2013-02-14 13:47:18

回答