使用CORBA连接客户端(在VirtualBox上)和服务器(在localhost上) - org.omg.CORBA.BAD_PARAM:

时间:2012-10-16 22:57:40

标签: java c++ virtualbox corba

我现在正在使用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选项有问题吗?我无法更改我的应用程序的目录树。

1 个答案:

答案 0 :(得分:1)

我个人认为你有两个问题。

  1. 类路径事。您是否在Client.class.Dir1中拥有名为Dir2的文件。如果没有,请查找它并将其添加到类路径中。如果有,请提供更多信息

  2. CORBA的事情;我想看看你的Orb.init();电话。其他一切看起来都不错。