You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Joshua Jackson <jo...@gmail.com> on 2007/12/17 11:59:30 UTC

WicketNotSerializableException

Dear all,

I got this message because there is a field that Wicket wants to
serialize but it can not be serialized. Now how do I remove this error
since I can not make tomcat's ApplicationContextFacade to be
Serializable.

2007-12-17 17:49:12,498 - [ERROR] - Objects                    - Error
serializing object class com.mycompany.dupe.pages.PricePage
[object=[Page class = com.mycompany.d
upe.pages.PricePage, id = 17, version = 0]]
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
Unable to serialize class:
org.apache.catalina.core.ApplicationContextFacade
Field hierarchy is:
  17 [class=com.mycompany.dupe.pages.PricePage, path=17]
    private java.lang.Object
org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
      private java.util.List
com.mycompany.dupe.pages.PricePage$PriceForm.prices[8]
[class=com.mycompany.dupe.pages.PricePage$GeneratorForm, path=17:generatorForm]
        javax.servlet.ServletContext
com.mycompany.dupe.pages.PricePage$GeneratorForm.context
[class=org.apache.catalina.core.ApplicationContextFacade] <----- field
 that is not serializable

Thanks in advance

-- 
I'm a coder not a drag-n-dropper

Blog: http://joshuajava.wordpress.com/

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


Re: WicketNotSerializableException

Posted by Joshua Jackson <jo...@gmail.com>.
Thanks Igor,

I get the clear picture now, I'll make a workaround from your advice.
I currently have problems with reference object that came from other
libs that is not Serializable.

Best Regards,

On Jan 23, 2008 2:01 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> anything that a page keeps reference to, directly or indirectly, needs
> to be serializable. for objects that are not serializable you should
> do what loadabledetachablemodel does: keep an object as a transient
> variable and have a way to look it up if its null. ive built a lot of
> stuff with wicket and this hasnt been a problem yet. sometimes i had
> to wrap or subclass objects that came from other libs because the devs
> didnt bother to make those objects serializable - not everyone thinks
> about this stuff - but other then that nothing major.

-- 
It's not going to be like this forever

Blog: http://joshuajava.wordpress.com/

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


Re: WicketNotSerializableException

Posted by Igor Vaynberg <ig...@gmail.com>.
anything that a page keeps reference to, directly or indirectly, needs
to be serializable. for objects that are not serializable you should
do what loadabledetachablemodel does: keep an object as a transient
variable and have a way to look it up if its null. ive built a lot of
stuff with wicket and this hasnt been a problem yet. sometimes i had
to wrap or subclass objects that came from other libs because the devs
didnt bother to make those objects serializable - not everyone thinks
about this stuff - but other then that nothing major.

-igor


On Jan 22, 2008 10:56 PM, Joshua Jackson <jo...@gmail.com> wrote:
> Looks like that this problem is viral. How do I work with objects that
> is not Serializable while on the other hand wicket want it to be
> Serializable?
>
> On Jan 23, 2008 11:31 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> > see SpringWebApplcation, it has methods to create same proxies @SpringBean does.
> >
> > -igor
>
>
>
>
> --
>
> It's not going to be like this forever
>
> Blog: http://joshuajava.wordpress.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: WicketNotSerializableException

Posted by Joshua Jackson <jo...@gmail.com>.
Looks like that this problem is viral. How do I work with objects that
is not Serializable while on the other hand wicket want it to be
Serializable?

On Jan 23, 2008 11:31 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> see SpringWebApplcation, it has methods to create same proxies @SpringBean does.
>
> -igor




-- 
It's not going to be like this forever

Blog: http://joshuajava.wordpress.com/

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


Re: WicketNotSerializableException

Posted by Igor Vaynberg <ig...@gmail.com>.
see SpringWebApplcation, it has methods to create same proxies @SpringBean does.

-igor


On Jan 22, 2008 8:27 PM, Joshua Jackson <jo...@gmail.com> wrote:
> Hi All,
>
> I have take a loot at this. But is there any solution to fix this
> without using @SpringBean since I am still on JDK1.4.
>
> Thanks in advance
>
> On Dec 17, 2007 7:50 PM, Evan Chooly <ev...@gmail.com> wrote:
> > it's the ApplicationContextFacade that can't be serialized.  you'll need to
> > mark this field as transient most likely.  Now, if this is, as I suspect, a
> > spring class for getting your dependencies, you'll have to refetch/recreate
> > this context after deserialization.  But  if you're using spring you  should
> > really look at wicket-spring and use @SpringBean to get your deps handed to
> > you.
>
>
> --
> It's not going to be like this forever
>
>
> Blog: http://joshuajava.wordpress.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: WicketNotSerializableException

Posted by Joshua Jackson <jo...@gmail.com>.
Hi All,

I have take a loot at this. But is there any solution to fix this
without using @SpringBean since I am still on JDK1.4.

Thanks in advance

On Dec 17, 2007 7:50 PM, Evan Chooly <ev...@gmail.com> wrote:
> it's the ApplicationContextFacade that can't be serialized.  you'll need to
> mark this field as transient most likely.  Now, if this is, as I suspect, a
> spring class for getting your dependencies, you'll have to refetch/recreate
> this context after deserialization.  But  if you're using spring you  should
> really look at wicket-spring and use @SpringBean to get your deps handed to
> you.


-- 
It's not going to be like this forever

Blog: http://joshuajava.wordpress.com/

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


Re: WicketNotSerializableException

Posted by Evan Chooly <ev...@gmail.com>.
it's the ApplicationContextFacade that can't be serialized.  you'll need to
mark this field as transient most likely.  Now, if this is, as I suspect, a
spring class for getting your dependencies, you'll have to refetch/recreate
this context after deserialization.  But  if you're using spring you  should
really look at wicket-spring and use @SpringBean to get your deps handed to
you.

On Dec 17, 2007 5:59 AM, Joshua Jackson <jo...@gmail.com> wrote:

> Dear all,
>
> I got this message because there is a field that Wicket wants to
> serialize but it can not be serialized. Now how do I remove this error
> since I can not make tomcat's ApplicationContextFacade to be
> Serializable.
>
> 2007-12-17 17:49:12,498 - [ERROR] - Objects                    - Error
> serializing object class com.mycompany.dupe.pages.PricePage
> [object=[Page class = com.mycompany.d
> upe.pages.PricePage, id = 17, version = 0]]
>
> org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
> Unable to serialize class:
> org.apache.catalina.core.ApplicationContextFacade
> Field hierarchy is:
>  17 [class=com.mycompany.dupe.pages.PricePage, path=17]
>    private java.lang.Object
> org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
>      private java.util.List
> com.mycompany.dupe.pages.PricePage$PriceForm.prices[8]
> [class=com.mycompany.dupe.pages.PricePage$GeneratorForm,
> path=17:generatorForm]
>        javax.servlet.ServletContext
> com.mycompany.dupe.pages.PricePage$GeneratorForm.context
> [class=org.apache.catalina.core.ApplicationContextFacade] <----- field
>  that is not serializable
>
> Thanks in advance
>
> --
> I'm a coder not a drag-n-dropper
>
> Blog: http://joshuajava.wordpress.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>