I am writing an rmi application. Everything works fine when I put all the classes in one directory (one package). However, when I try to separate the server part and the client part, exceptions occur with the client. The server is working fine. Here is part of the stack trace after the exception:
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 the unicastRemoteobject method to pass an instance of the object from the client to the server for a callback. I also use rmic to create a stub file for the object. It seems that the program cannot find this stub class on CLASSPATH. I am wondering how to solve this problem?
source
share