Azad
Azad

Reputation: 407

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!" string on cmd screen.But when I try to run it on two machines I faced an exception.

enter image description here while I have a HelloClient.class in my related directory! 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. enter image description here

Upvotes: 1

Views: 116

Answers (1)

tuergeist
tuergeist

Reputation: 9391

You have to run the HelloClient in the directory where HelloClient.class resides OR you have to set the classpath to the directory via java -cp <dirname> HelloClient

Upvotes: 1

Related Questions