Having SerializationException when trying to return custom object type
I just create the most simple Singleton EJB to return a custom serializable object, but I'm getting the following exception when I invoke the remote method:
org.jboss.serial.exception.SerializationExcep开发者_JAVA百科tion: Could not create instance of model.Usuario - model.Usuario
It works fine with simple types and normal classes (String for example) but not for an object pertaining to a class I created.
I'm using JBoss 6.0 and Eclipse.
What could I be missing?
Thanks in advance, Saul
The class you are trying to serialize must implement the Serializable
marker interface or extend a class that implements it. Also, every non-transient member of your class must also be Serializable
.
1.You should make your Object implementing Serializable
2.Have all nonserializable fields marked as transient
.
精彩评论