Search code examples
javarmi

Problem running RMI server


I am trying to run a RMI server application. I issue the following command: java exemploRMI.Server

and I got the following error:

Problemas no Servidor:
RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: exemploRMI.OlaRemoto

How to correct this error?

Problemas no Serivord means "Problems in the server" in Portuguese.


Solution

  • Try this:

    java -classpath . exemploRMI.Server
    

    It seems like a classpath issue. Basically, java needs to know where to look for the name of the class you are calling. It doesn't auto assume that the current directory is part of your classpath. Classpath