• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Am i missing something here?

 
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
expectation is the root of all heartache - shakespeare. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic