Java rmi client exceptions

I am writing an rmi application. Everything works fine when I put all the classes in one directory (one package). However, when I try to separate the server part and the client part, exceptions occur with the client. The server is working fine. Here is part of the stack trace after the exception:

Exception in thread "main" 
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
        java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
        java.lang.ClassNotFoundException: com.clientpackage.ClientImpl_Stub (no security manager: RMI class loader disabled)

I used the unicastRemoteobject method to pass an instance of the object from the client to the server for a callback. I also use rmic to create a stub file for the object. It seems that the program cannot find this stub class on CLASSPATH. I am wondering how to solve this problem?

+3
source share
1 answer

, rmic. Java Java 5, .

Java 5 . rmic , Java 1.4 .

Java 5 , rmic , RMI, .

, RMI, .

+3

Source: https://habr.com/ru/post/1718840/


All Articles