Search code examples
javarmiclassnotfoundexception

RemoteException java.rmi.UnmarshalException: error unmarshalling return


I'm running the program here on 2 JVMs on diff physical machines. I get the error

RemoteException
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
    java.lang.ClassNotFoundException: CalculatorImpl_Stub (no security manager: RMI class loader disabled)

I've even tried running it on the same machine(unchanged program) and it works but it doesnt work on diff machines. Can someone pls help me out?

@beny23- Thanks but I still end up with this error:

RemoteException
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
java.lang.ClassNotFoundException: CalculatorImpl_Stub

How can the client side have a copy of CalculatorImpl_stub?


Solution

  • It sounds like your not using a security manager:

    Have you got a policy file (my.policy):

    grant {
      permission java.security.AllPermission;
    };
    

    and run your program using

    java -Djava.security.manager -Djava.security.policy=/some/path/my.policy MyClass