Search code examples
javarmiclassnotfound

RMI ClassNotFoundException


I have an RMI program which runs fine on my computer, but when I run it on my schools computer I get a ClassNotFoundException for my class that is extending Remote. I've looked at some similar questions, my errors are almost identical, but the solutions offered there are not working for me. I can't pass arguments to RMI registry because it is already running and is shared with other students. I tried setting the system.property inside of my program, but that didn't help. I also tried using rmic but that didn't work either.

Here is my error message from Exception.getMessage():

Server exception: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: chordNode

These are the questions with the same type of problem.

rmi class can not found exception

running rmi server, classnotfound


Solution

  • The problem was using an rmiregistry that was launched by another user. This meant that the classpath being used by the rmiregistry was based on another users environment. To fix this, I launched my own rmiregistry on another port.