简体   繁体   English

Java中的客户端应用程序异常

[英]Client application exception in java

I want to run an CORBA Application using java on two machines.When I run this app on one machine there is no troubl, and I can see the "Hello World!" 我想在两台计算机上使用Java运行CORBA应用程序。在一台计算机上运行该应用程序时,没有任何麻烦,并且可以看到“ Hello World!”。 string on cmd screen.But when I try to run it on two machines I faced an exception. cmd屏幕上的字符串。但是当我尝试在两台计算机上运行它时,我遇到了一个异常。

在此处输入图片说明 while I have a HelloClient.class in my related directory! 而我在相关目录中有一个HelloClient.class! The commands that I used to compiling and running this application are: On the client machine: 我用来编译和运行此应用程序的命令是:在客户端计算机上:

idlj -fall Hello.idl  //to mapping the Hello.idl to java
javac *.java HelloApp\*.java  //to compile the all .java files such as                HelloClient,Hello,Hellostub,HelloHelper,HelloHolder,HelloOperation and HelloPOA.

On server machine: 在服务器计算机上:

javac *.java  //to compile HelloServer and HelloImpl classes.
srart orbd -ORBInitialPort 1050 -ORBInitialHost 192.168.138.134  //to start Object Request Broker Daemon
start java HelloServer -ORBInitialPort 1050  //to start HelloServer

On client machine: 在客户端计算机上:

java HelloClient -ORBInitialHost 192.168.138.134  //to run the Hello application client.

but when I run this application in one machine I can get the output correctly. 但是当我在一台机器上运行此应用程序时,我可以正确获得输出。 在此处输入图片说明

您必须在HelloClient.class所在的目录中运行HelloClient ,或者必须通过java -cp <dirname> HelloClient设置目录的类路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM