0

I am getting below exception when I run the rmi server code

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: com.server.test.TestRMIInterface

Below are the steps I am following

  1. Open command prompt and run rmiregistry -J-Djava.rmi.server.useCodebaseOnly=false 5000
  2. Run server code as java -Djava.rmi.server.codebase="file:/D:/Test/Code/jartouse/" -jar TestRMIServer.jar

TestRMIServer.jar has dependency on TestRMIInterface.jar and I have placed the TestRMIInterface.jar in jartouse directory

It works fine if I run the rmi server as given below

java -Djava.rmi.server.codebase="file:/D:/Test/Code/jartouse/TestRMIInterface.jar" -jar TestRMIServer.jar

Not sure what is missing here. Any help on this is appreciated

user207421
  • 305,947
  • 44
  • 307
  • 483
Mohan
  • 233
  • 1
  • 8
  • 21
  • Do any of these help to fix or explain what you're observing? [1](https://stackoverflow.com/questions/464687/running-rmi-server-classnotfound) and a linked [article](https://stackoverflow.com/questions/9531158/java-rmi-serverexception-remoteexception-occurred-in-server-thread-classnotfou) – JGlass Jan 22 '18 at 17:08
  • Given that you know (2) works, it is hard to see why you are even attempting (1), or asking the question, and unless the directory specified in (1) is the head of a package-structured hierarchy of .class files, there is no reason why it should work at all. It doesn't have anything to do with [tag:Java-ee]: don't tag indiscriminately. – user207421 Jan 25 '18 at 18:17

0 Answers0