简体   繁体   中英

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.SerializationException: 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

1.You should make your Object implementing Serializable

2.Have all nonserializable fields marked as transient .

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM