RMI load class exception
Scenario: when writing data to solr, the application calls the method in the encapsulated jar. The connection is normal, but an exception is thrown when writing json data.
Errors are as follows: Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
Java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
Java.lang.ClassNotFoundException: net.sf.json.JSONObject (no security manager: RMI class loader disabled)
At sun.rmi.server.UnicastServerRef.dispatch (UnicastServerRef.java:377)
At sun.rmi.transport.Transport$1.run (Transport.java:200)
At sun.rmi.transport.Transport$1.run (Transport.java:197)
At java.security.AccessController.doPrivileged (Native Method)
At sun.rmi.transport.Transport.serviceCall (Transport.java:196)
At sun.rmi.transport.tcp.TCPTransport.handleMessages (TCPTransport.java:568)
At sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0 (TCPTransport.java:826)
At sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0 (TCPTransport.java:683)
At java.security.AccessController.doPrivileged (Native Method)
At sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run (TCPTransport.java:682)
At java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
At java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
At java.lang.Thread.run (Thread.java:745)
At sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer (Unknown Source)
At sun.rmi.transport.StreamRemoteCall.executeCall (Unknown Source)
At sun.rmi.server.UnicastRef.invoke (Unknown Source)
At java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod (Unknown Source)
At java.rmi.server.RemoteObjectInvocationHandler.invoke (Unknown Source)
At com.sun.proxy.$Proxy5.invoke (Unknown Source)
At org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke (RmiClientInterceptor.java:398)
At org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke (RmiClientInterceptor.java:344)
... 6 more
Net.sf.json.JSONObject this jar I introduced, but read the error is for security, not loaded, and finally changed to fastjson will be no problem, the use of classes need to be consistent with the classes used in it.