Search code examples
javarmiclassnotfoundexception

Why are my stub classes not being found?


I am running an RMI server on a VM, but I keep getting this error:

Failure during Name registration: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: MarketBBImpl_Stub

Failure during Name registration: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: AMPLocation_Stub

All of the class files are in the same directory(including the stub files), and when I run it localy there are no problems.

Anyone know what's going on here?


Solution

  • If you look at the stack trace you will probably see bind() or rebind() down there. That indicates that the server concerned is the RMI Registry. It needs access to your classes via its CLASSPATH.