Skip to main content

Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

4 replies [Last post]
zambizzi
Offline
Joined: 2005-08-19

Here's one for the Wicketeers out there. I'm completely at wits end here and I hope someone can point out what's wrong.

I've got an e-commerce application that is simply moving between two pages using setRedirectPage() when going from a product detail page to the shopping cart page. There isn't anything remarkable about either of these two pages, they're basically like any other in the app. However, when the cart page loads, I get the exception at the bottom of this message.

I've tried implementing Serializable on the Cart() page class but it makes no difference. It points out "com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate" as the culprit. I use a stateful session bean (ShoppingCart) which is passed around the app as part of the session (custom WebSession-derived class)

This is the only page this occurs on. There are several other steps in the cart's checkout process that look exactly like this one and the exception doesn't happen on any of the others

Any ideas?

Exception:

25717 [httpSSLWorkerThread-8080-1] ERROR org.apache.wicket.util.lang.Objects - Error serializing object class com.myapp.ui.Cart [object=[Page class = com.myapp.ui.Cart, id = 3, version = 0]]
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
Field hierarchy is:
3 [class=com.myapp.ui.Cart, path=3]
private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
private org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.markupHelper[6] [class=org.apache.wicket.markup.html.form.Form, path=3:cartForm]
private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
private java.lang.Object org.apache.wicket.MarkupContainer.children[0] [class=com.myapp.ui.Cart$1, path=3:cartForm:orderLinesView]
final com.myapp.session.ShoppingCartLocal com.myapp.ui.Cart$1.val$cart [class=$Proxy92]
protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate] <----- field that is not serializable
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:392)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:392)
at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
at org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:684)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1120)
at org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
at org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(DiskPageStore.java:840)
at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.put(SecondLevelCacheSessionStore.java:332)
at org.apache.wicket.Session.requestDetached(Session.java:1404)
at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1176)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1454)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.io.NotSerializableException: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
... 38 more

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Justin Lee

Fair enough. I think I unsub'd from that list a while back... As long
as he's all set. :)

Major Péter wrote:
> That was a Wicket-related problem, and it is solved at users@wicket list. ;)
>
> 2009-11-19 20:41 keltezéssel, Justin Lee írta:
>
>> Can you share the source for that Page class?
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Justin Lee

Can you share the source for that Page class?

glassfish@javadesktop.org wrote:
> Here's one for the Wicketeers out there. I'm completely at wits end here and I hope someone can point out what's wrong.
>
> I've got an e-commerce application that is simply moving between two pages using setRedirectPage() when going from a product detail page to the shopping cart page. There isn't anything remarkable about either of these two pages, they're basically like any other in the app. However, when the cart page loads, I get the exception at the bottom of this message.
>
> I've tried implementing Serializable on the Cart() page class but it makes no difference. It points out "com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate" as the culprit. I use a stateful session bean (ShoppingCart) which is passed around the app as part of the session (custom WebSession-derived class)
>
> This is the only page this occurs on. There are several other steps in the cart's checkout process that look exactly like this one and the exception doesn't happen on any of the others
>
> Any ideas?
>
> Exception:
>
> 25717 [httpSSLWorkerThread-8080-1] ERROR org.apache.wicket.util.lang.Objects - Error serializing object class com.myapp.ui.Cart [object=[Page class = com.myapp.ui.Cart, id = 3, version = 0]]
> org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
> Field hierarchy is:
> 3 [class=com.myapp.ui.Cart, path=3]
> private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
> private org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.markupHelper[6] [class=org.apache.wicket.markup.html.form.Form, path=3:cartForm]
> private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
> private java.lang.Object org.apache.wicket.MarkupContainer.children[0] [class=com.myapp.ui.Cart$1, path=3:cartForm:orderLinesView]
> final com.myapp.session.ShoppingCartLocal com.myapp.ui.Cart$1.val$cart [class=$Proxy92]
> protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate] <----- field that is not serializable
> at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
> at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
> at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
> at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
> at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
> at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:392)
> at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
> at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
> at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:392)
> at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
> at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
> at org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:684)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
> at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
> at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1120)
> at org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
> at org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(DiskPageStore.java:840)
> at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.put(SecondLevelCacheSessionStore.java:332)
> at org.apache.wicket.Session.requestDetached(Session.java:1404)
> at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1176)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1454)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
> at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
> at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> Caused by: java.io.NotSerializableException: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
> at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
> at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
> at org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
> ... 38 more
> [Message sent by forum member 'zambizzi' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=372432
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Major Péter

That was a Wicket-related problem, and it is solved at users@wicket list. ;)

2009-11-19 20:41 keltezéssel, Justin Lee írta:
> Can you share the source for that Page class?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

zambizzi
Offline
Joined: 2005-08-19

Yep! All done. I was referencing the SFSB's interface inside of an Anonymous class inside of the Wicket page and the reference could not be serialized.