我现在正在使用Java / C ++和CORBA中的简单gui应用程序。我希望VirtualBox上的客户端连接到localhost上的服务器。当我有一个简单的应用程序时,就像我之前写的一篇关于它的文章一样好。但是当涉及到运行客户端需要一些args女巫javas -cp
选项时,我会遇到错误。 (当我在localhost上同时拥有客户端和服务器时,没有这样的问题!)我在VirtualBox上使用Win XP,在localhost上使用Ubuntu。
我的错误:
WARNING: "IOP00100007: (BAD_PARAM) string_to_object conversion failed due to bad
scheme name"
org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 7 completed: No
at com.sun.corba.se.impl.logging.OMGSystemException.soBadSchemeName(Unkn
own Source)
at com.sun.corba.se.impl.logging.OMGSystemException.soBadSchemeName(Unkn
own Source)
at com.sun.corba.se.impl.resolver.INSURLOperationImpl.operate(Unknown So
urce)
at com.sun.corba.se.impl.resolver.ORBInitRefResolverImpl.resolve(Unknown
Source)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown
Source)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown
Source)
at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(Unknown
Source)
at ClientConnection.connect(ClientConnection.java:57)
at Client.main(Client.java:295)
Exception in thread "main" org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 7
completed: No
at com.sun.corba.se.impl.logging.OMGSystemException.soBadSchemeName(Unkn
own Source)
at com.sun.corba.se.impl.logging.OMGSystemException.soBadSchemeName(Unkn
own Source)
at com.sun.corba.se.impl.resolver.INSURLOperationImpl.operate(Unknown So
urce)
at com.sun.corba.se.impl.resolver.ORBInitRefResolverImpl.resolve(Unknown
Source)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown
Source)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown
Source)
at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(Unknown
Source)
at ClientConnection.connect(ClientConnection.java:57)
at Client.main(Client.java:295)
make[1]: *** [run] Error 1
ClientConnection.java:57是一行objRef = clientORB.resolve_initial_references("NameService");
Client.java:295是一行:ClientConnection.connect(args);
connect
方法只是普通的客户端连接corba代码。
我跑了我的例子:
1)
C:\Temp\Client>java -cp .:../Dir1:../Dir2 Client -ORBInitRef NameService
=corbaloc::192.168.56.1:2809/NameService
Error: Could not find or load main class Client
所以它甚至根本没有运行..
2)借助Makefile:
HOST = 192.168.56.1
PORT = 2809
NAMESERVICE = NameService
run:
java -cp .:../Dir1:../Dir2 Client -ORBInitRef NameService=corbaloc::$(HOST):$(PORT)/$(NAMESERVICE)
键入make run
,然后我收到了之前发布的错误。怎么了?我的意思是,一个简单的代码工作正常,但gui版本不想... -cp
选项有问题吗?我无法更改我的应用程序的目录树。
答案 0 :(得分:1)
我个人认为你有两个问题。
类路径事。您是否在Client.class
或.
或Dir1
中拥有名为Dir2
的文件。如果没有,请查找它并将其添加到类路径中。如果有,请提供更多信息
CORBA的事情;我想看看你的Orb.init();
电话。其他一切看起来都不错。