I created a policy file that gives the permission for my machine to run both the client and the server, I also passed the ports to them. Inside the server I instantiate RMI Security (since if I take it the policy does not work)
Server started works ok. Customer starts running ok. I finish inserting the last field to create a new user in the database and comes these errors.
Client:
java.rmi.UnmarshalException: Error unmarshaling return; nested exception is: java.lang.ClassNotFoundException: javax.persistence.PersistenceException (no security manager: RMI class loader disabled) at sun.rmi.transport.StreamRemoteCall.executeCall (StreamRemoteCall.java:247) at sun.rmi.server.UnicastRef.invoke (UnicastRef.java:162) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod (RemoteObjectInvocationHandler.java:194) at java.rmi.server.RemoteObjectInvocationHandler.invoke (RemoteObjectInvocationHandler.java:148) at com.sun.proxy. $ Proxy0.insert (Unknown Source) at rmi.client.Services.addressUsers (Servicos.java:42) at rmi.cliente.RMICliente.main (RMICliente.java:16) Caused by: java.lang.ClassNotFoundException: javax.persistence.PersistenceException (no security manager: RMI class loader disabled) at sun.rmi.server.LoaderHandler.loadClass (LoaderHandler.java:396) at sun.rmi.server.LoaderHandler.loadClass (LoaderHandler.java:186) at java.rmi.server.RMIClassLoader $ 2.loadClass (RMIClassLoader.java:637) at java.rmi.server.RMIClassLoader.loadClass (RMIClassLoader.java:264) at sun.rmi.server.MarshalInputStream.resolveClass (MarshalInputStream.java:214) at java.io.ObjectInputStream.readNonProxyDesc (ObjectInputStream.java:1613) at java.io.ObjectInputStream.readClassDesc (ObjectInputStream.java:1518) at java.io.ObjectInputStream.readOrdinaryObject (ObjectInputStream.java:1774) at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1351) at java.io.ObjectInputStream.readObject (ObjectInputStream.java:371) at sun.rmi.transport.StreamRemoteCall.executeCall (StreamRemoteCall.java:245) ... 6 more
Note: The server has stopped giving error, now it's just the client.