i get this error when i try to call a remote interface:
java.rmi.MarshalException: error marshalling arguments; nested exception is: java.io.NotSerializableException: javax.crypto.Cipher
These are the interfaces:
public interface Operacion extends Remote{
String operacionDesencripta(byte ciphertext[],Key key,Cipher cipher)
throws RemoteException;
}
and i call it like this:
rmiServidor.operacionDesencripta(ciphertext,key,cipher);
After processing all that data
What is the question exactly? The error is pretty clear — you cannot serialize the
Ciphertype. If you check out the Javadoc for this type, it will tell you:So instead of passing the
Cipherdirectly, you could pass a transformation string instead (Stringis serializable and thus “remotable”).