Java RMI ServerException - java.lang.ClassNotFoundException: org.prog.rmi.RmiServer_Stub

前端 未结 2 670
别跟我提以往
别跟我提以往 2021-01-28 11:45

I have inherited some Java RMI client/server code, and while it runs fine on one machine, I haven\'t been able to get it to run in my dev environment.

The problem is whe

相关标签:
2条回答
  • 2021-01-28 12:30

    You haven't regenerated the stub with rmic, or the Registry doesn't have access to it via its classpath.

    0 讨论(0)
  • 2021-01-28 12:36

    After some further investigation and following RMI tutorials it appeared that there was a problem with the RMI registration server on port 1099.

    When I stared the RMI registration server on another port (e.g. 2005) and changed these lines of code

    LocateRegistry.createRegistry(2005);
    

    and

    Naming.rebind("//127.0.0.1:2055/RmiServer", obj);
    

    This ran sucessfully without errors and my client was able to connect.

    I hope this answer helps others with this error. Let me know if anyone needs any more detailed information.

    0 讨论(0)
提交回复
热议问题