Eu estou chamando este método remoto:
RespuestaError<Co> cox(String a, String b, String c, int d) throws RemoteException;
Eu estou recebendo esse erro
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: jtwitter.base.RespuestaError
Ele está dizendo que RespuestaError não é serializável, mas é:
public class RespuestaError<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 8483079015565009698L;
private T returned;
private Error error;
public RespuestaError(T returned, Error error)
{
//...
}
//...
}
Onde Error
é um enum. Neste caso particular T
é:
public class Co implements Serializable {
private static final long serialVersionUID = 2759254657635643074L;
private String a;
private int b;
private Us c;
public Co(String a, int b, Us c)
{
//...
}
//...
}
E a classe Us é:
public class Us implements Serializable {
private static final long serialVersionUID = -6725570673833522155L;
private int a;
private String b;
private String c;
private String d;
private String e;
private int f;
public Us(int a, String b, String c, String d, String e, int f)
{
//...
}
//...
}
Everithing estende Serializable Eu não vejo o erro.
Respostas:
0 para resposta № 1Não há erro no código. O problema é que eu não estou executando o código que estou pensando em executar. Limpar e recompilar todos os arquivos resolve esse problema.