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
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."
posted 16 years ago
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
Please do not shoot the fish in this barrel. But you can shoot at this tiny ad: