You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Watrous <dw...@gmail.com> on 2013/06/11 21:39:49 UTC

Do all POJOs have to implement Serializable?

Hi,

I have an existing application tier that I package as a jar and place in a
maven repository. I've been working to expose some of this application
through Wicket. It's easy to include it in the pom, but I keep getting:

ERROR - JavaSerializer             - Error serializing object MyObject  ...
 The object type is not Serializable!

Do all of my classes have to implement serializable in order to use them in
Wicket?

Daniel

Re: Do all POJOs have to implement Serializable?

Posted by Sven Meier <sv...@meiers.net>.
If your component holds a reference to a pojo (either directly or via a 
model), then the pojo has to be serializable.

If you can let go of the pojo at the end of the request (in your 
component's #onDetach() or your model's #detach()), then your pojo won't 
be serialized along with your page.

Take a look at LoadableDetachableModel for an example.

Sven

On 06/11/2013 09:39 PM, Daniel Watrous wrote:
> Hi,
>
> I have an existing application tier that I package as a jar and place in a
> maven repository. I've been working to expose some of this application
> through Wicket. It's easy to include it in the pom, but I keep getting:
>
> ERROR - JavaSerializer             - Error serializing object MyObject  ...
>   The object type is not Serializable!
>
> Do all of my classes have to implement serializable in order to use them in
> Wicket?
>
> Daniel
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org