• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Am i missing something here?  RSS feed

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://");

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,
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!