• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stub class not found but its THERE

 
Jacob Hoda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a bare bone RMI program.
It all works fine when i use local host IE 127.0.0.1.
But now I'm testing it on a server.
I get java.lang.ClassNotFoundException on my Stub class. Even though its in the directory.
When I compiled i did javac -classpath . *.java
than created the stub from implementation file.. IE rmic -v1.2 ClassImpl
I than seperated my files into server and client (placed in sep folders)
uploaded to the server
ran rmiregistry 5544 which is the port i'm using
executed the server file and thats when i get the error of the stub not found.
Any help is appreciated.
Regards, Jacob
 
Julie de Wet
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again just a guess... But as far as I understand it, your problem could be due to one of two things...
1. You haven't set the codebase property correctly - forgotten the trailing /
2. I quote "Note: Before you start the rmiregistry, you must make sure that the shell or window in which you will run the registry, either has no CLASSPATH set or has a CLASSPATH that does not include the path to any classes that you want downloaded to your client, including the stubs for your remote object implementation classes.
If you start the rmiregistry, and it can find your stub classes in its CLASSPATH, it will ignore the server's java.rmi.server.codebase property, and as a result, your client(s) will not be able to download the stub code for your remote object."
 
Jacob Hoda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for you reply.
The problem is that I was supposed to run RMIREGISTRY on the server directory. I did not do that. I ran it on the main directory. It all works well now thank you for taking your time in replying to my message.
Jacob
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!