I'm writing an rmi application. Everything works perfectly fine when i put the all classes in one directory(one single package). However, when i try to split the server part and the client part, exceptions happens to the client. Server works normally. Here is part of the stack trace of after exception happens:
Exception in thread "main"
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.clientpackage.ClientImpl_Stub (no security manager: RMI class loader disabled)
I used unicastRemoteobject method to pass the server an instance of an object from client for the callback. I also use rmic to generate the stub file for the object. It seems that the the program can't find that stub class on its CLASSPATH. I'm wondering how to I solve this problem?