Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Am i missing something here?  RSS feed

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm running on a SINGLE pc (lets call it pc A) a simple Hello World test using RMI. It works fine. The problem is when i try to start the client from ANOTHER pc (pc B).

I am doing the following...

Steps on pc A (server):
-----------------------
I compile the server object, client object and interface.
I create the stub file using >rmic ServerImpl
I start the registry with >start rmiregistry.
I start the server.

note: in the client object i have the following:

HelloInterface server = (HelloInterface)Naming.lookup("rmi://192.168.0.3:1099/Server");

the ip address is the LAN ip of the server.

Steps on pc B (client):
-----------------------
Copy the generated client.class file from the server to the client (pc B).
I run the client and it says it cannot find HelloInterface (which is on the server (pc A).

note: the server is run with JRE 1.4 and the client runs with JRE 1.5, but even when i tried it on two JRE 1.4, i get the same problem.

The actual message i get on the client is a NoClassDefFoundError: interfavceName;


It's like it can't find the interface or stub file.
Where am i going wrong?

Thanks in advance and regards,
Marzo.
 
Nirav Patel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You require intterface to be present on both the side (client, server), so check that you have that remote interface available on the client, plus the stub of the server (o/p from rmic)... Actually this is not required in new JDK (Java SE 5.0)....

Hope this will help.
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neerav is saying right ..The interface must be present both the
server as well as on the client side..

Put your interface class in client pc and see it works
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!