我正在尝试创建一个使用CORBA进行交互的java客户端/服务器应用程序。我跟着this example并且能够使用'Java IDL对象请求代理守护进程,orbd'使其工作。但当我将服务器更改为指向我们的本地omniNames安装而不是orbd时,我收到此错误:
C:\Hello>java HelloServer -ORBInitialPort 7000 -ORBInitialHost 192.168.1.5
ERROR: org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: OMG minor code: 1 completed: No
org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: OMG minor code: 1 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:897)
at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_0.getSystemException(ReplyMessage_1_0.java:94)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:572)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:452)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:339)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:129)
at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:89)
at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(BootstrapResolverImpl.java:107)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1151)
at HelloServer.main(HelloServer.java:51)
HelloServer Exiting ...
导致错误的行:
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
就omniNames服务器而言,我知道它的安装和配置正确,因为我们有无数其他已经在使用它的应用程序(c ++)。我查看了这些其他应用程序的源代码,他们似乎做了同样的事情:
tmpRef = moOrb->resolve_initial_references("NameService");
我知道它不是网络错误,因为如果我使用错误的端口,则获得无连接错误。我在绳索的尽头,有什么想法吗?
答案 0 :(得分:2)
问题最终发生在我的java服务器和我的CORBA服务器之间。我使用omniNames作为CORBA服务器(omniOrbs的一部分)。显然,java有一个非标准的bootstrap,默认情况下与omniNames不兼容。要启用对java引导程序的支持,可以使用以下参数启动omniNames:
'-ORBsupportBootstrapAgent 1'
添加后,一切正常。 More can be read here.