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

前端 未结 2 671
别跟我提以往
别跟我提以往 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条回答
  •  闹比i
    闹比i (楼主)
    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.

提交回复
热议问题