You must assure that you start rmiregistry having your stubs in the classpath.
I use rmiregistry command to run the rmi registry
And here is the directory structure
tryrmi
****HelloServer.class (The Server class)
****SayHello.class (The interface that the class implements)
****Main.class (which registers an instance of the HelloServer in the RMI registry)
****HelloServer_Stub.class which is generated when i run the rmic tool.
I run the Main program using the following command
from the directory that contains tryrmi :
java -classpath . tryrmi.Main
Note : When i have deleted the Sub file the exception was :
ClassNotFoundException tryrmi.SayHello
The problem is also happening with NetBeans.I dont know what i am doing wrong???
One more note i forgot to mention : I wrote code
Class.forName("tryrmi.HelloServer_Stub") and no exception is thrown.
Only within the RMI where it does not recogonize the Stub class.
[ October 14, 2006: Message edited by: Khaled Mahmoud ]
[ October 14, 2006: Message edited by: Khaled Mahmoud ]