This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Problem. Please help

 
Ambrose R Tati
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I've got a very basic RMI application. Everything compiles fine.
After starting the rmiregistry, I try to run the server program
I get a java.rmi.UnmarshalException
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: RemoteServer_Stub
My java programs:
1) ServerInterface.java (defines a single remote method)
2) RemoteServer.java (implements ServerInterface.java)
3) Client.java (calls remote method)
After compiling using javac and rmic I get the following classes:
1) ServerInterface.java
2) RemoteServer.class
3) RemoteServer_Stub.class
4) RemoteServer_Skel.class
5) Client.class
I'm doing all this on Win98/Jdk1.3
Can somebody help please?
Thanks
Ambrose Tati
 
chakri ch
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check ur classpath settings. Stub classes should be in the classpath.
-chakri
 
chakri ch
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And of course stub class should be present in both the client and server side. That is it should be accesible to both client and server. So copy the stub class file and put that in the client folder too (if at all it is in different directory)
-chakri
 
Joe Murray
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by chakri ch:
And of course stub class should be present in both the client and server side. That is it should be accesible to both client and server. So copy the stub class file and put that in the client folder too (if at all it is in different directory)
-chakri

That is the same problem that I am having right now. I thought the RMI client was supposed to download the Stub when it attempts to access the server?
 
chakri ch
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will not download the stub class on its own. U got to zip the stub class along with the client code.
-srinivas
 
Gregory Smith
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stub class could be downloaded to the client if you are using Code Mobility. For information on Code Mobility see chapter 9 of java.rmi by Esmond Pitt and Kathleen McNiff.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic