You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by VGJ <za...@gmail.com> on 2009/11/18 22:50:25 UTC
Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
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
Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by VGJ <za...@gmail.com>.
Ha! I deserve that. I was hesitant to put the "stuff happens here" instead
of just dumping another 100 lines of code in there. Dammit. ;)
Anyhow, worked great. Thanks for clearing it up for me!
On Thu, Nov 19, 2009 at 11:26 AM, Igor Vaynberg <ig...@gmail.com>wrote:
> phase 1: collect underpants
> phase 2: ?
> phase 3: profit
>
> :)
>
> -igor
>
> On Thu, Nov 19, 2009 at 10:06 AM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
> > The problems always seem to occur in that cloud in the middle of the
> diagram
> > that says "stuff happens here" or "this is where the magic happens".....
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> >
> > On Thu, Nov 19, 2009 at 12:04 PM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> i am going to guess that inside "//stuff happens here..." you access
> >> the final cart field. when you do this inside an anonymous class it
> >> keeps a reference, so that is what is causing your serialization
> >> problem. instead of having the final field, do the lookup
> >> "((UserSession)getSession()).getCart();" directly inside the "//stuff
> >> happens here..."
> >>
> >> -igor
> >>
> >> On Thu, Nov 19, 2009 at 9:57 AM, VGJ <za...@gmail.com> wrote:
> >> > I reference the bean's interface in order to use it, yes. What's the
> >> > alternative? Would I instead access everything through a proxy class
> and
> >> > store the proxy itself into the WebSession, to retain a reference? As
> it
> >> > is, each page in the checkout process changes the Stateful bean's
> >> properties
> >> > and stores it back into the WebSession. Here is what the Cart page
> looks
> >> > like, in summary:
> >> >
> >> > public class Cart extends BasePage
> >> > {
> >> > public Cart()
> >> > {
> >> > //get session - derives from Wicket's WebSession
> >> > UserSession session = (UserSession)getSession();
> >> >
> >> > //get cart from session
> >> > final ShoppingCartLocal cart =
> ((UserSession)getSession()).getCart();
> >> >
> >> > //create form
> >> > Form form = new Form("cartForm");
> >> >
> >> > //add list of non-bundle Configuration objects to form
> >> > form.add(new ListView("orderLinesView", cart.getOrderLines())
> >> > {
> >> > protected void populateItem(ListItem item)
> >> > {
> >> > //stuff happens here...
> >> > }
> >> > }
> >> >
> >> > //...and so on...and so forth...
> >> > }
> >> > }
> >> >
> >> > On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg <
> igor.vaynberg@gmail.com
> >> >wrote:
> >> >
> >> >> according to the stacktrace, this component:
> >> >>
> >> >> path=3:cartForm:orderLinesView]
> >> >>
> >> >> has this reference: final com.myapp.session.ShoppingCartLocal
> >> >>
> >> >> so looks like you are holding on to your bean directly instead of
> using
> >> a
> >> >> proxy.
> >> >>
> >> >> -igor
> >> >>
> >> >> On Thu, Nov 19, 2009 at 8:48 AM, VGJ <za...@gmail.com> wrote:
> >> >> > One would think...however I tried it and it makes no difference.
> None
> >> of
> >> >> my
> >> >> > proxy classes implement Serializable and this exception occurs
> nowhere
> >> >> else,
> >> >> > also.
> >> >> >
> >> >> > Just to be certain, I just went through and implemented it on *all*
> of
> >> my
> >> >> > proxy classes in this app. No change.
> >> >> >
> >> >> >
> >> >> > On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg <
> >> igor.vaynberg@gmail.com
> >> >> >wrote:
> >> >> >
> >> >> >> your CartProxy does not implement serialiazable so it cannot be
> >> >> >> serialized...
> >> >> >>
> >> >> >> -igor
> >> >> >>
> >> >> >> On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
> >> >> >> > I'm not injecting it directly. I'm using a "proxy" class to get
> a
> >> >> >> reference
> >> >> >> > to the stateless bean's interface like so:
> >> >> >> >
> >> >> >> > public class CartProxy
> >> >> >> > {
> >> >> >> > private static ShoppingCartLocal lookupCartInterface()
> >> >> >> > {
> >> >> >> > ShoppingCartLocal cart = null;
> >> >> >> >
> >> >> >> > try
> >> >> >> > {
> >> >> >> > InitialContext ctx = new InitialContext();
> >> >> >> > cart =
> >> >> >> > (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
> >> >> >> > }
> >> >> >> > catch (NamingException exp)
> >> >> >> > {
> >> >> >> > LogProxy.saveEntry(exp);
> >> >> >> > }
> >> >> >> >
> >> >> >> > return cart;
> >> >> >> > }
> >> >> >> > }
> >> >> >> >
> >> >> >> > The reference in web.xml makes this possible:
> >> >> >> >
> >> >> >> > <ejb-local-ref>
> >> >> >> > <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
> >> >> >> > <ejb-ref-type>Session</ejb-ref-type>
> >> >> >> > <local>com.myapp.session.ShoppingCartLocal</local>
> >> >> >> > <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
> >> >> >> > </ejb-local-ref>
> >> >> >> >
> >> >> >> > Is this not supposed to work? It's been in production for over
> 3
> >> >> >> yrs...so I
> >> >> >> > hope it does! :)
> >> >> >> >
> >> >> >> > The entire app is built this way and this one page is the only
> one
> >> >> >> throwing
> >> >> >> > this exception. It works, it doesn't stop the show or affect
> >> anything
> >> >> >> > negatively, so far as I can tell. I would just like to get rid
> of
> >> it
> >> >> and
> >> >> >> > figure out what it is.
> >> >> >> >
> >> >> >> > Thanks again,
> >> >> >> >
> >> >> >> > -v
> >> >> >> >
> >> >> >> > On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <
> >> >> igor.vaynberg@gmail.com
> >> >> >> >wrote:
> >> >> >> >
> >> >> >> >> wicket stuff contains a wicket-jee module which supports
> injecting
> >> >> ejb
> >> >> >> >> beans into wicket components the same way that wicket-spring
> >> injects
> >> >> >> >> wicket beans.
> >> >> >> >>
> >> >> >> >> -igor
> >> >> >> >>
> >> >> >> >> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
> >> >> >> >> <pi...@systemworks.be> wrote:
> >> >> >> >> > Your cart has a reference to the sessionBean ShopingCart.
> This
> >> is
> >> >> not
> >> >> >> >> > allowed, however. The IOC incjectionsupport makes this
> possible
> >> by
> >> >> >> >> wrapping
> >> >> >> >> > this EJB reference with a serializable proxy.
> >> >> >> >> >
> >> >> >> >> > I only have expecience with wicket-spring end it works great.
> >> (In
> >> >> your
> >> >> >> >> case,
> >> >> >> >> > define your ejb reference in spring and inject it via
> >> wicket-spring
> >> >> >> >> support
> >> >> >> >> > in your page.
> >> >> >> >> > problem solved!
> >> >> >> >> >
> >> >> >> >> > Pieter
> >> >> >> >> >
> >> >> >> >> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com>
> >> wrote:
> >> >> >> >> >
> >> >> >> >> >> 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
> >> >> >> >> >>
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> > --
> >> >> >> >> > Pieter Degraeuwe
> >> >> >> >> > Systemworks bvba
> >> >> >> >> > Belgiëlaan 61
> >> >> >> >> > 9070 Destelbergen
> >> >> >> >> > GSM: +32 (0)485/68.60.85
> >> >> >> >> > Email: pieter.degraeuwe@systemworks.be
> >> >> >> >> > visit us at http://www.systemworks.be
> >> >> >> >> >
> >> >> >> >>
> >> >> >> >>
> >> ---------------------------------------------------------------------
> >> >> >> >> 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
> >> >> >>
> >> >> >>
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> 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
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by Igor Vaynberg <ig...@gmail.com>.
phase 1: collect underpants
phase 2: ?
phase 3: profit
:)
-igor
On Thu, Nov 19, 2009 at 10:06 AM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> The problems always seem to occur in that cloud in the middle of the diagram
> that says "stuff happens here" or "this is where the magic happens".....
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Thu, Nov 19, 2009 at 12:04 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> i am going to guess that inside "//stuff happens here..." you access
>> the final cart field. when you do this inside an anonymous class it
>> keeps a reference, so that is what is causing your serialization
>> problem. instead of having the final field, do the lookup
>> "((UserSession)getSession()).getCart();" directly inside the "//stuff
>> happens here..."
>>
>> -igor
>>
>> On Thu, Nov 19, 2009 at 9:57 AM, VGJ <za...@gmail.com> wrote:
>> > I reference the bean's interface in order to use it, yes. What's the
>> > alternative? Would I instead access everything through a proxy class and
>> > store the proxy itself into the WebSession, to retain a reference? As it
>> > is, each page in the checkout process changes the Stateful bean's
>> properties
>> > and stores it back into the WebSession. Here is what the Cart page looks
>> > like, in summary:
>> >
>> > public class Cart extends BasePage
>> > {
>> > public Cart()
>> > {
>> > //get session - derives from Wicket's WebSession
>> > UserSession session = (UserSession)getSession();
>> >
>> > //get cart from session
>> > final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();
>> >
>> > //create form
>> > Form form = new Form("cartForm");
>> >
>> > //add list of non-bundle Configuration objects to form
>> > form.add(new ListView("orderLinesView", cart.getOrderLines())
>> > {
>> > protected void populateItem(ListItem item)
>> > {
>> > //stuff happens here...
>> > }
>> > }
>> >
>> > //...and so on...and so forth...
>> > }
>> > }
>> >
>> > On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >
>> >> according to the stacktrace, this component:
>> >>
>> >> path=3:cartForm:orderLinesView]
>> >>
>> >> has this reference: final com.myapp.session.ShoppingCartLocal
>> >>
>> >> so looks like you are holding on to your bean directly instead of using
>> a
>> >> proxy.
>> >>
>> >> -igor
>> >>
>> >> On Thu, Nov 19, 2009 at 8:48 AM, VGJ <za...@gmail.com> wrote:
>> >> > One would think...however I tried it and it makes no difference. None
>> of
>> >> my
>> >> > proxy classes implement Serializable and this exception occurs nowhere
>> >> else,
>> >> > also.
>> >> >
>> >> > Just to be certain, I just went through and implemented it on *all* of
>> my
>> >> > proxy classes in this app. No change.
>> >> >
>> >> >
>> >> > On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg <
>> igor.vaynberg@gmail.com
>> >> >wrote:
>> >> >
>> >> >> your CartProxy does not implement serialiazable so it cannot be
>> >> >> serialized...
>> >> >>
>> >> >> -igor
>> >> >>
>> >> >> On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
>> >> >> > I'm not injecting it directly. I'm using a "proxy" class to get a
>> >> >> reference
>> >> >> > to the stateless bean's interface like so:
>> >> >> >
>> >> >> > public class CartProxy
>> >> >> > {
>> >> >> > private static ShoppingCartLocal lookupCartInterface()
>> >> >> > {
>> >> >> > ShoppingCartLocal cart = null;
>> >> >> >
>> >> >> > try
>> >> >> > {
>> >> >> > InitialContext ctx = new InitialContext();
>> >> >> > cart =
>> >> >> > (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
>> >> >> > }
>> >> >> > catch (NamingException exp)
>> >> >> > {
>> >> >> > LogProxy.saveEntry(exp);
>> >> >> > }
>> >> >> >
>> >> >> > return cart;
>> >> >> > }
>> >> >> > }
>> >> >> >
>> >> >> > The reference in web.xml makes this possible:
>> >> >> >
>> >> >> > <ejb-local-ref>
>> >> >> > <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
>> >> >> > <ejb-ref-type>Session</ejb-ref-type>
>> >> >> > <local>com.myapp.session.ShoppingCartLocal</local>
>> >> >> > <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
>> >> >> > </ejb-local-ref>
>> >> >> >
>> >> >> > Is this not supposed to work? It's been in production for over 3
>> >> >> yrs...so I
>> >> >> > hope it does! :)
>> >> >> >
>> >> >> > The entire app is built this way and this one page is the only one
>> >> >> throwing
>> >> >> > this exception. It works, it doesn't stop the show or affect
>> anything
>> >> >> > negatively, so far as I can tell. I would just like to get rid of
>> it
>> >> and
>> >> >> > figure out what it is.
>> >> >> >
>> >> >> > Thanks again,
>> >> >> >
>> >> >> > -v
>> >> >> >
>> >> >> > On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <
>> >> igor.vaynberg@gmail.com
>> >> >> >wrote:
>> >> >> >
>> >> >> >> wicket stuff contains a wicket-jee module which supports injecting
>> >> ejb
>> >> >> >> beans into wicket components the same way that wicket-spring
>> injects
>> >> >> >> wicket beans.
>> >> >> >>
>> >> >> >> -igor
>> >> >> >>
>> >> >> >> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
>> >> >> >> <pi...@systemworks.be> wrote:
>> >> >> >> > Your cart has a reference to the sessionBean ShopingCart. This
>> is
>> >> not
>> >> >> >> > allowed, however. The IOC incjectionsupport makes this possible
>> by
>> >> >> >> wrapping
>> >> >> >> > this EJB reference with a serializable proxy.
>> >> >> >> >
>> >> >> >> > I only have expecience with wicket-spring end it works great.
>> (In
>> >> your
>> >> >> >> case,
>> >> >> >> > define your ejb reference in spring and inject it via
>> wicket-spring
>> >> >> >> support
>> >> >> >> > in your page.
>> >> >> >> > problem solved!
>> >> >> >> >
>> >> >> >> > Pieter
>> >> >> >> >
>> >> >> >> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com>
>> wrote:
>> >> >> >> >
>> >> >> >> >> 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
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > Pieter Degraeuwe
>> >> >> >> > Systemworks bvba
>> >> >> >> > Belgiëlaan 61
>> >> >> >> > 9070 Destelbergen
>> >> >> >> > GSM: +32 (0)485/68.60.85
>> >> >> >> > Email: pieter.degraeuwe@systemworks.be
>> >> >> >> > visit us at http://www.systemworks.be
>> >> >> >> >
>> >> >> >>
>> >> >> >>
>> ---------------------------------------------------------------------
>> >> >> >> 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
>> >> >>
>> >> >>
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by Jeremy Thomerson <je...@wickettraining.com>.
The problems always seem to occur in that cloud in the middle of the diagram
that says "stuff happens here" or "this is where the magic happens".....
--
Jeremy Thomerson
http://www.wickettraining.com
On Thu, Nov 19, 2009 at 12:04 PM, Igor Vaynberg <ig...@gmail.com>wrote:
> i am going to guess that inside "//stuff happens here..." you access
> the final cart field. when you do this inside an anonymous class it
> keeps a reference, so that is what is causing your serialization
> problem. instead of having the final field, do the lookup
> "((UserSession)getSession()).getCart();" directly inside the "//stuff
> happens here..."
>
> -igor
>
> On Thu, Nov 19, 2009 at 9:57 AM, VGJ <za...@gmail.com> wrote:
> > I reference the bean's interface in order to use it, yes. What's the
> > alternative? Would I instead access everything through a proxy class and
> > store the proxy itself into the WebSession, to retain a reference? As it
> > is, each page in the checkout process changes the Stateful bean's
> properties
> > and stores it back into the WebSession. Here is what the Cart page looks
> > like, in summary:
> >
> > public class Cart extends BasePage
> > {
> > public Cart()
> > {
> > //get session - derives from Wicket's WebSession
> > UserSession session = (UserSession)getSession();
> >
> > //get cart from session
> > final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();
> >
> > //create form
> > Form form = new Form("cartForm");
> >
> > //add list of non-bundle Configuration objects to form
> > form.add(new ListView("orderLinesView", cart.getOrderLines())
> > {
> > protected void populateItem(ListItem item)
> > {
> > //stuff happens here...
> > }
> > }
> >
> > //...and so on...and so forth...
> > }
> > }
> >
> > On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> according to the stacktrace, this component:
> >>
> >> path=3:cartForm:orderLinesView]
> >>
> >> has this reference: final com.myapp.session.ShoppingCartLocal
> >>
> >> so looks like you are holding on to your bean directly instead of using
> a
> >> proxy.
> >>
> >> -igor
> >>
> >> On Thu, Nov 19, 2009 at 8:48 AM, VGJ <za...@gmail.com> wrote:
> >> > One would think...however I tried it and it makes no difference. None
> of
> >> my
> >> > proxy classes implement Serializable and this exception occurs nowhere
> >> else,
> >> > also.
> >> >
> >> > Just to be certain, I just went through and implemented it on *all* of
> my
> >> > proxy classes in this app. No change.
> >> >
> >> >
> >> > On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg <
> igor.vaynberg@gmail.com
> >> >wrote:
> >> >
> >> >> your CartProxy does not implement serialiazable so it cannot be
> >> >> serialized...
> >> >>
> >> >> -igor
> >> >>
> >> >> On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
> >> >> > I'm not injecting it directly. I'm using a "proxy" class to get a
> >> >> reference
> >> >> > to the stateless bean's interface like so:
> >> >> >
> >> >> > public class CartProxy
> >> >> > {
> >> >> > private static ShoppingCartLocal lookupCartInterface()
> >> >> > {
> >> >> > ShoppingCartLocal cart = null;
> >> >> >
> >> >> > try
> >> >> > {
> >> >> > InitialContext ctx = new InitialContext();
> >> >> > cart =
> >> >> > (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
> >> >> > }
> >> >> > catch (NamingException exp)
> >> >> > {
> >> >> > LogProxy.saveEntry(exp);
> >> >> > }
> >> >> >
> >> >> > return cart;
> >> >> > }
> >> >> > }
> >> >> >
> >> >> > The reference in web.xml makes this possible:
> >> >> >
> >> >> > <ejb-local-ref>
> >> >> > <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
> >> >> > <ejb-ref-type>Session</ejb-ref-type>
> >> >> > <local>com.myapp.session.ShoppingCartLocal</local>
> >> >> > <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
> >> >> > </ejb-local-ref>
> >> >> >
> >> >> > Is this not supposed to work? It's been in production for over 3
> >> >> yrs...so I
> >> >> > hope it does! :)
> >> >> >
> >> >> > The entire app is built this way and this one page is the only one
> >> >> throwing
> >> >> > this exception. It works, it doesn't stop the show or affect
> anything
> >> >> > negatively, so far as I can tell. I would just like to get rid of
> it
> >> and
> >> >> > figure out what it is.
> >> >> >
> >> >> > Thanks again,
> >> >> >
> >> >> > -v
> >> >> >
> >> >> > On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <
> >> igor.vaynberg@gmail.com
> >> >> >wrote:
> >> >> >
> >> >> >> wicket stuff contains a wicket-jee module which supports injecting
> >> ejb
> >> >> >> beans into wicket components the same way that wicket-spring
> injects
> >> >> >> wicket beans.
> >> >> >>
> >> >> >> -igor
> >> >> >>
> >> >> >> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
> >> >> >> <pi...@systemworks.be> wrote:
> >> >> >> > Your cart has a reference to the sessionBean ShopingCart. This
> is
> >> not
> >> >> >> > allowed, however. The IOC incjectionsupport makes this possible
> by
> >> >> >> wrapping
> >> >> >> > this EJB reference with a serializable proxy.
> >> >> >> >
> >> >> >> > I only have expecience with wicket-spring end it works great.
> (In
> >> your
> >> >> >> case,
> >> >> >> > define your ejb reference in spring and inject it via
> wicket-spring
> >> >> >> support
> >> >> >> > in your page.
> >> >> >> > problem solved!
> >> >> >> >
> >> >> >> > Pieter
> >> >> >> >
> >> >> >> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com>
> wrote:
> >> >> >> >
> >> >> >> >> 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
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > --
> >> >> >> > Pieter Degraeuwe
> >> >> >> > Systemworks bvba
> >> >> >> > Belgiëlaan 61
> >> >> >> > 9070 Destelbergen
> >> >> >> > GSM: +32 (0)485/68.60.85
> >> >> >> > Email: pieter.degraeuwe@systemworks.be
> >> >> >> > visit us at http://www.systemworks.be
> >> >> >> >
> >> >> >>
> >> >> >>
> ---------------------------------------------------------------------
> >> >> >> 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
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> 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: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by VGJ <za...@gmail.com>.
Yep, you're right - I have a link inside of the populateItem method that
calls it one time, like so:
Link removeLink = new Link("removeLink")
{
public void onClick()
{
try
{
//proxy method to remove line item
CartProxy.removeOrderLine(cart, line); //here she is!
//set cart back to session
((UserSession)getSession()).setCart(newCart);
//redirect to self
setResponsePage(new Cart());
}
catch (Exception exp)
{
LogProxy.saveEntry(exp);
}
}
};
I'll test out your suggestion, I hope it's that simple! Thanks Igor.
On Thu, Nov 19, 2009 at 11:04 AM, Igor Vaynberg <ig...@gmail.com>wrote:
> i am going to guess that inside "//stuff happens here..." you access
> the final cart field. when you do this inside an anonymous class it
> keeps a reference, so that is what is causing your serialization
> problem. instead of having the final field, do the lookup
> "((UserSession)getSession()).getCart();" directly inside the "//stuff
> happens here..."
>
> -igor
>
> On Thu, Nov 19, 2009 at 9:57 AM, VGJ <za...@gmail.com> wrote:
> > I reference the bean's interface in order to use it, yes. What's the
> > alternative? Would I instead access everything through a proxy class and
> > store the proxy itself into the WebSession, to retain a reference? As it
> > is, each page in the checkout process changes the Stateful bean's
> properties
> > and stores it back into the WebSession. Here is what the Cart page looks
> > like, in summary:
> >
> > public class Cart extends BasePage
> > {
> > public Cart()
> > {
> > //get session - derives from Wicket's WebSession
> > UserSession session = (UserSession)getSession();
> >
> > //get cart from session
> > final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();
> >
> > //create form
> > Form form = new Form("cartForm");
> >
> > //add list of non-bundle Configuration objects to form
> > form.add(new ListView("orderLinesView", cart.getOrderLines())
> > {
> > protected void populateItem(ListItem item)
> > {
> > //stuff happens here...
> > }
> > }
> >
> > //...and so on...and so forth...
> > }
> > }
> >
> > On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> according to the stacktrace, this component:
> >>
> >> path=3:cartForm:orderLinesView]
> >>
> >> has this reference: final com.myapp.session.ShoppingCartLocal
> >>
> >> so looks like you are holding on to your bean directly instead of using
> a
> >> proxy.
> >>
> >> -igor
> >>
> >> On Thu, Nov 19, 2009 at 8:48 AM, VGJ <za...@gmail.com> wrote:
> >> > One would think...however I tried it and it makes no difference. None
> of
> >> my
> >> > proxy classes implement Serializable and this exception occurs nowhere
> >> else,
> >> > also.
> >> >
> >> > Just to be certain, I just went through and implemented it on *all* of
> my
> >> > proxy classes in this app. No change.
> >> >
> >> >
> >> > On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg <
> igor.vaynberg@gmail.com
> >> >wrote:
> >> >
> >> >> your CartProxy does not implement serialiazable so it cannot be
> >> >> serialized...
> >> >>
> >> >> -igor
> >> >>
> >> >> On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
> >> >> > I'm not injecting it directly. I'm using a "proxy" class to get a
> >> >> reference
> >> >> > to the stateless bean's interface like so:
> >> >> >
> >> >> > public class CartProxy
> >> >> > {
> >> >> > private static ShoppingCartLocal lookupCartInterface()
> >> >> > {
> >> >> > ShoppingCartLocal cart = null;
> >> >> >
> >> >> > try
> >> >> > {
> >> >> > InitialContext ctx = new InitialContext();
> >> >> > cart =
> >> >> > (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
> >> >> > }
> >> >> > catch (NamingException exp)
> >> >> > {
> >> >> > LogProxy.saveEntry(exp);
> >> >> > }
> >> >> >
> >> >> > return cart;
> >> >> > }
> >> >> > }
> >> >> >
> >> >> > The reference in web.xml makes this possible:
> >> >> >
> >> >> > <ejb-local-ref>
> >> >> > <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
> >> >> > <ejb-ref-type>Session</ejb-ref-type>
> >> >> > <local>com.myapp.session.ShoppingCartLocal</local>
> >> >> > <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
> >> >> > </ejb-local-ref>
> >> >> >
> >> >> > Is this not supposed to work? It's been in production for over 3
> >> >> yrs...so I
> >> >> > hope it does! :)
> >> >> >
> >> >> > The entire app is built this way and this one page is the only one
> >> >> throwing
> >> >> > this exception. It works, it doesn't stop the show or affect
> anything
> >> >> > negatively, so far as I can tell. I would just like to get rid of
> it
> >> and
> >> >> > figure out what it is.
> >> >> >
> >> >> > Thanks again,
> >> >> >
> >> >> > -v
> >> >> >
> >> >> > On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <
> >> igor.vaynberg@gmail.com
> >> >> >wrote:
> >> >> >
> >> >> >> wicket stuff contains a wicket-jee module which supports injecting
> >> ejb
> >> >> >> beans into wicket components the same way that wicket-spring
> injects
> >> >> >> wicket beans.
> >> >> >>
> >> >> >> -igor
> >> >> >>
> >> >> >> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
> >> >> >> <pi...@systemworks.be> wrote:
> >> >> >> > Your cart has a reference to the sessionBean ShopingCart. This
> is
> >> not
> >> >> >> > allowed, however. The IOC incjectionsupport makes this possible
> by
> >> >> >> wrapping
> >> >> >> > this EJB reference with a serializable proxy.
> >> >> >> >
> >> >> >> > I only have expecience with wicket-spring end it works great.
> (In
> >> your
> >> >> >> case,
> >> >> >> > define your ejb reference in spring and inject it via
> wicket-spring
> >> >> >> support
> >> >> >> > in your page.
> >> >> >> > problem solved!
> >> >> >> >
> >> >> >> > Pieter
> >> >> >> >
> >> >> >> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com>
> wrote:
> >> >> >> >
> >> >> >> >> 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
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > --
> >> >> >> > Pieter Degraeuwe
> >> >> >> > Systemworks bvba
> >> >> >> > Belgiëlaan 61
> >> >> >> > 9070 Destelbergen
> >> >> >> > GSM: +32 (0)485/68.60.85
> >> >> >> > Email: pieter.degraeuwe@systemworks.be
> >> >> >> > visit us at http://www.systemworks.be
> >> >> >> >
> >> >> >>
> >> >> >>
> ---------------------------------------------------------------------
> >> >> >> 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
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> 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: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by Igor Vaynberg <ig...@gmail.com>.
i am going to guess that inside "//stuff happens here..." you access
the final cart field. when you do this inside an anonymous class it
keeps a reference, so that is what is causing your serialization
problem. instead of having the final field, do the lookup
"((UserSession)getSession()).getCart();" directly inside the "//stuff
happens here..."
-igor
On Thu, Nov 19, 2009 at 9:57 AM, VGJ <za...@gmail.com> wrote:
> I reference the bean's interface in order to use it, yes. What's the
> alternative? Would I instead access everything through a proxy class and
> store the proxy itself into the WebSession, to retain a reference? As it
> is, each page in the checkout process changes the Stateful bean's properties
> and stores it back into the WebSession. Here is what the Cart page looks
> like, in summary:
>
> public class Cart extends BasePage
> {
> public Cart()
> {
> //get session - derives from Wicket's WebSession
> UserSession session = (UserSession)getSession();
>
> //get cart from session
> final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();
>
> //create form
> Form form = new Form("cartForm");
>
> //add list of non-bundle Configuration objects to form
> form.add(new ListView("orderLinesView", cart.getOrderLines())
> {
> protected void populateItem(ListItem item)
> {
> //stuff happens here...
> }
> }
>
> //...and so on...and so forth...
> }
> }
>
> On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> according to the stacktrace, this component:
>>
>> path=3:cartForm:orderLinesView]
>>
>> has this reference: final com.myapp.session.ShoppingCartLocal
>>
>> so looks like you are holding on to your bean directly instead of using a
>> proxy.
>>
>> -igor
>>
>> On Thu, Nov 19, 2009 at 8:48 AM, VGJ <za...@gmail.com> wrote:
>> > One would think...however I tried it and it makes no difference. None of
>> my
>> > proxy classes implement Serializable and this exception occurs nowhere
>> else,
>> > also.
>> >
>> > Just to be certain, I just went through and implemented it on *all* of my
>> > proxy classes in this app. No change.
>> >
>> >
>> > On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >
>> >> your CartProxy does not implement serialiazable so it cannot be
>> >> serialized...
>> >>
>> >> -igor
>> >>
>> >> On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
>> >> > I'm not injecting it directly. I'm using a "proxy" class to get a
>> >> reference
>> >> > to the stateless bean's interface like so:
>> >> >
>> >> > public class CartProxy
>> >> > {
>> >> > private static ShoppingCartLocal lookupCartInterface()
>> >> > {
>> >> > ShoppingCartLocal cart = null;
>> >> >
>> >> > try
>> >> > {
>> >> > InitialContext ctx = new InitialContext();
>> >> > cart =
>> >> > (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
>> >> > }
>> >> > catch (NamingException exp)
>> >> > {
>> >> > LogProxy.saveEntry(exp);
>> >> > }
>> >> >
>> >> > return cart;
>> >> > }
>> >> > }
>> >> >
>> >> > The reference in web.xml makes this possible:
>> >> >
>> >> > <ejb-local-ref>
>> >> > <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
>> >> > <ejb-ref-type>Session</ejb-ref-type>
>> >> > <local>com.myapp.session.ShoppingCartLocal</local>
>> >> > <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
>> >> > </ejb-local-ref>
>> >> >
>> >> > Is this not supposed to work? It's been in production for over 3
>> >> yrs...so I
>> >> > hope it does! :)
>> >> >
>> >> > The entire app is built this way and this one page is the only one
>> >> throwing
>> >> > this exception. It works, it doesn't stop the show or affect anything
>> >> > negatively, so far as I can tell. I would just like to get rid of it
>> and
>> >> > figure out what it is.
>> >> >
>> >> > Thanks again,
>> >> >
>> >> > -v
>> >> >
>> >> > On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <
>> igor.vaynberg@gmail.com
>> >> >wrote:
>> >> >
>> >> >> wicket stuff contains a wicket-jee module which supports injecting
>> ejb
>> >> >> beans into wicket components the same way that wicket-spring injects
>> >> >> wicket beans.
>> >> >>
>> >> >> -igor
>> >> >>
>> >> >> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
>> >> >> <pi...@systemworks.be> wrote:
>> >> >> > Your cart has a reference to the sessionBean ShopingCart. This is
>> not
>> >> >> > allowed, however. The IOC incjectionsupport makes this possible by
>> >> >> wrapping
>> >> >> > this EJB reference with a serializable proxy.
>> >> >> >
>> >> >> > I only have expecience with wicket-spring end it works great. (In
>> your
>> >> >> case,
>> >> >> > define your ejb reference in spring and inject it via wicket-spring
>> >> >> support
>> >> >> > in your page.
>> >> >> > problem solved!
>> >> >> >
>> >> >> > Pieter
>> >> >> >
>> >> >> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com> wrote:
>> >> >> >
>> >> >> >> 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
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > Pieter Degraeuwe
>> >> >> > Systemworks bvba
>> >> >> > Belgiëlaan 61
>> >> >> > 9070 Destelbergen
>> >> >> > GSM: +32 (0)485/68.60.85
>> >> >> > Email: pieter.degraeuwe@systemworks.be
>> >> >> > visit us at http://www.systemworks.be
>> >> >> >
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> 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
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> 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: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by VGJ <za...@gmail.com>.
I reference the bean's interface in order to use it, yes. What's the
alternative? Would I instead access everything through a proxy class and
store the proxy itself into the WebSession, to retain a reference? As it
is, each page in the checkout process changes the Stateful bean's properties
and stores it back into the WebSession. Here is what the Cart page looks
like, in summary:
public class Cart extends BasePage
{
public Cart()
{
//get session - derives from Wicket's WebSession
UserSession session = (UserSession)getSession();
//get cart from session
final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();
//create form
Form form = new Form("cartForm");
//add list of non-bundle Configuration objects to form
form.add(new ListView("orderLinesView", cart.getOrderLines())
{
protected void populateItem(ListItem item)
{
//stuff happens here...
}
}
//...and so on...and so forth...
}
}
On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg <ig...@gmail.com>wrote:
> according to the stacktrace, this component:
>
> path=3:cartForm:orderLinesView]
>
> has this reference: final com.myapp.session.ShoppingCartLocal
>
> so looks like you are holding on to your bean directly instead of using a
> proxy.
>
> -igor
>
> On Thu, Nov 19, 2009 at 8:48 AM, VGJ <za...@gmail.com> wrote:
> > One would think...however I tried it and it makes no difference. None of
> my
> > proxy classes implement Serializable and this exception occurs nowhere
> else,
> > also.
> >
> > Just to be certain, I just went through and implemented it on *all* of my
> > proxy classes in this app. No change.
> >
> >
> > On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> your CartProxy does not implement serialiazable so it cannot be
> >> serialized...
> >>
> >> -igor
> >>
> >> On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
> >> > I'm not injecting it directly. I'm using a "proxy" class to get a
> >> reference
> >> > to the stateless bean's interface like so:
> >> >
> >> > public class CartProxy
> >> > {
> >> > private static ShoppingCartLocal lookupCartInterface()
> >> > {
> >> > ShoppingCartLocal cart = null;
> >> >
> >> > try
> >> > {
> >> > InitialContext ctx = new InitialContext();
> >> > cart =
> >> > (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
> >> > }
> >> > catch (NamingException exp)
> >> > {
> >> > LogProxy.saveEntry(exp);
> >> > }
> >> >
> >> > return cart;
> >> > }
> >> > }
> >> >
> >> > The reference in web.xml makes this possible:
> >> >
> >> > <ejb-local-ref>
> >> > <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
> >> > <ejb-ref-type>Session</ejb-ref-type>
> >> > <local>com.myapp.session.ShoppingCartLocal</local>
> >> > <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
> >> > </ejb-local-ref>
> >> >
> >> > Is this not supposed to work? It's been in production for over 3
> >> yrs...so I
> >> > hope it does! :)
> >> >
> >> > The entire app is built this way and this one page is the only one
> >> throwing
> >> > this exception. It works, it doesn't stop the show or affect anything
> >> > negatively, so far as I can tell. I would just like to get rid of it
> and
> >> > figure out what it is.
> >> >
> >> > Thanks again,
> >> >
> >> > -v
> >> >
> >> > On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <
> igor.vaynberg@gmail.com
> >> >wrote:
> >> >
> >> >> wicket stuff contains a wicket-jee module which supports injecting
> ejb
> >> >> beans into wicket components the same way that wicket-spring injects
> >> >> wicket beans.
> >> >>
> >> >> -igor
> >> >>
> >> >> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
> >> >> <pi...@systemworks.be> wrote:
> >> >> > Your cart has a reference to the sessionBean ShopingCart. This is
> not
> >> >> > allowed, however. The IOC incjectionsupport makes this possible by
> >> >> wrapping
> >> >> > this EJB reference with a serializable proxy.
> >> >> >
> >> >> > I only have expecience with wicket-spring end it works great. (In
> your
> >> >> case,
> >> >> > define your ejb reference in spring and inject it via wicket-spring
> >> >> support
> >> >> > in your page.
> >> >> > problem solved!
> >> >> >
> >> >> > Pieter
> >> >> >
> >> >> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com> wrote:
> >> >> >
> >> >> >> 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
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Pieter Degraeuwe
> >> >> > Systemworks bvba
> >> >> > Belgiëlaan 61
> >> >> > 9070 Destelbergen
> >> >> > GSM: +32 (0)485/68.60.85
> >> >> > Email: pieter.degraeuwe@systemworks.be
> >> >> > visit us at http://www.systemworks.be
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> 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
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by Igor Vaynberg <ig...@gmail.com>.
according to the stacktrace, this component:
path=3:cartForm:orderLinesView]
has this reference: final com.myapp.session.ShoppingCartLocal
so looks like you are holding on to your bean directly instead of using a proxy.
-igor
On Thu, Nov 19, 2009 at 8:48 AM, VGJ <za...@gmail.com> wrote:
> One would think...however I tried it and it makes no difference. None of my
> proxy classes implement Serializable and this exception occurs nowhere else,
> also.
>
> Just to be certain, I just went through and implemented it on *all* of my
> proxy classes in this app. No change.
>
>
> On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> your CartProxy does not implement serialiazable so it cannot be
>> serialized...
>>
>> -igor
>>
>> On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
>> > I'm not injecting it directly. I'm using a "proxy" class to get a
>> reference
>> > to the stateless bean's interface like so:
>> >
>> > public class CartProxy
>> > {
>> > private static ShoppingCartLocal lookupCartInterface()
>> > {
>> > ShoppingCartLocal cart = null;
>> >
>> > try
>> > {
>> > InitialContext ctx = new InitialContext();
>> > cart =
>> > (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
>> > }
>> > catch (NamingException exp)
>> > {
>> > LogProxy.saveEntry(exp);
>> > }
>> >
>> > return cart;
>> > }
>> > }
>> >
>> > The reference in web.xml makes this possible:
>> >
>> > <ejb-local-ref>
>> > <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
>> > <ejb-ref-type>Session</ejb-ref-type>
>> > <local>com.myapp.session.ShoppingCartLocal</local>
>> > <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
>> > </ejb-local-ref>
>> >
>> > Is this not supposed to work? It's been in production for over 3
>> yrs...so I
>> > hope it does! :)
>> >
>> > The entire app is built this way and this one page is the only one
>> throwing
>> > this exception. It works, it doesn't stop the show or affect anything
>> > negatively, so far as I can tell. I would just like to get rid of it and
>> > figure out what it is.
>> >
>> > Thanks again,
>> >
>> > -v
>> >
>> > On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >
>> >> wicket stuff contains a wicket-jee module which supports injecting ejb
>> >> beans into wicket components the same way that wicket-spring injects
>> >> wicket beans.
>> >>
>> >> -igor
>> >>
>> >> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
>> >> <pi...@systemworks.be> wrote:
>> >> > Your cart has a reference to the sessionBean ShopingCart. This is not
>> >> > allowed, however. The IOC incjectionsupport makes this possible by
>> >> wrapping
>> >> > this EJB reference with a serializable proxy.
>> >> >
>> >> > I only have expecience with wicket-spring end it works great. (In your
>> >> case,
>> >> > define your ejb reference in spring and inject it via wicket-spring
>> >> support
>> >> > in your page.
>> >> > problem solved!
>> >> >
>> >> > Pieter
>> >> >
>> >> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com> wrote:
>> >> >
>> >> >> 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
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Pieter Degraeuwe
>> >> > Systemworks bvba
>> >> > Belgiëlaan 61
>> >> > 9070 Destelbergen
>> >> > GSM: +32 (0)485/68.60.85
>> >> > Email: pieter.degraeuwe@systemworks.be
>> >> > visit us at http://www.systemworks.be
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by VGJ <za...@gmail.com>.
One would think...however I tried it and it makes no difference. None of my
proxy classes implement Serializable and this exception occurs nowhere else,
also.
Just to be certain, I just went through and implemented it on *all* of my
proxy classes in this app. No change.
On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg <ig...@gmail.com>wrote:
> your CartProxy does not implement serialiazable so it cannot be
> serialized...
>
> -igor
>
> On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
> > I'm not injecting it directly. I'm using a "proxy" class to get a
> reference
> > to the stateless bean's interface like so:
> >
> > public class CartProxy
> > {
> > private static ShoppingCartLocal lookupCartInterface()
> > {
> > ShoppingCartLocal cart = null;
> >
> > try
> > {
> > InitialContext ctx = new InitialContext();
> > cart =
> > (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
> > }
> > catch (NamingException exp)
> > {
> > LogProxy.saveEntry(exp);
> > }
> >
> > return cart;
> > }
> > }
> >
> > The reference in web.xml makes this possible:
> >
> > <ejb-local-ref>
> > <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
> > <ejb-ref-type>Session</ejb-ref-type>
> > <local>com.myapp.session.ShoppingCartLocal</local>
> > <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
> > </ejb-local-ref>
> >
> > Is this not supposed to work? It's been in production for over 3
> yrs...so I
> > hope it does! :)
> >
> > The entire app is built this way and this one page is the only one
> throwing
> > this exception. It works, it doesn't stop the show or affect anything
> > negatively, so far as I can tell. I would just like to get rid of it and
> > figure out what it is.
> >
> > Thanks again,
> >
> > -v
> >
> > On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> wicket stuff contains a wicket-jee module which supports injecting ejb
> >> beans into wicket components the same way that wicket-spring injects
> >> wicket beans.
> >>
> >> -igor
> >>
> >> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
> >> <pi...@systemworks.be> wrote:
> >> > Your cart has a reference to the sessionBean ShopingCart. This is not
> >> > allowed, however. The IOC incjectionsupport makes this possible by
> >> wrapping
> >> > this EJB reference with a serializable proxy.
> >> >
> >> > I only have expecience with wicket-spring end it works great. (In your
> >> case,
> >> > define your ejb reference in spring and inject it via wicket-spring
> >> support
> >> > in your page.
> >> > problem solved!
> >> >
> >> > Pieter
> >> >
> >> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com> wrote:
> >> >
> >> >> 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
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Pieter Degraeuwe
> >> > Systemworks bvba
> >> > Belgiëlaan 61
> >> > 9070 Destelbergen
> >> > GSM: +32 (0)485/68.60.85
> >> > Email: pieter.degraeuwe@systemworks.be
> >> > visit us at http://www.systemworks.be
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> 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: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by Igor Vaynberg <ig...@gmail.com>.
your CartProxy does not implement serialiazable so it cannot be serialized...
-igor
On Thu, Nov 19, 2009 at 7:30 AM, VGJ <za...@gmail.com> wrote:
> I'm not injecting it directly. I'm using a "proxy" class to get a reference
> to the stateless bean's interface like so:
>
> public class CartProxy
> {
> private static ShoppingCartLocal lookupCartInterface()
> {
> ShoppingCartLocal cart = null;
>
> try
> {
> InitialContext ctx = new InitialContext();
> cart =
> (ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
> }
> catch (NamingException exp)
> {
> LogProxy.saveEntry(exp);
> }
>
> return cart;
> }
> }
>
> The reference in web.xml makes this possible:
>
> <ejb-local-ref>
> <ejb-ref-name>ShoppingCartBean</ejb-ref-name>
> <ejb-ref-type>Session</ejb-ref-type>
> <local>com.myapp.session.ShoppingCartLocal</local>
> <ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
> </ejb-local-ref>
>
> Is this not supposed to work? It's been in production for over 3 yrs...so I
> hope it does! :)
>
> The entire app is built this way and this one page is the only one throwing
> this exception. It works, it doesn't stop the show or affect anything
> negatively, so far as I can tell. I would just like to get rid of it and
> figure out what it is.
>
> Thanks again,
>
> -v
>
> On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> wicket stuff contains a wicket-jee module which supports injecting ejb
>> beans into wicket components the same way that wicket-spring injects
>> wicket beans.
>>
>> -igor
>>
>> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
>> <pi...@systemworks.be> wrote:
>> > Your cart has a reference to the sessionBean ShopingCart. This is not
>> > allowed, however. The IOC incjectionsupport makes this possible by
>> wrapping
>> > this EJB reference with a serializable proxy.
>> >
>> > I only have expecience with wicket-spring end it works great. (In your
>> case,
>> > define your ejb reference in spring and inject it via wicket-spring
>> support
>> > in your page.
>> > problem solved!
>> >
>> > Pieter
>> >
>> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com> wrote:
>> >
>> >> 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
>> >>
>> >
>> >
>> >
>> > --
>> > Pieter Degraeuwe
>> > Systemworks bvba
>> > Belgiëlaan 61
>> > 9070 Destelbergen
>> > GSM: +32 (0)485/68.60.85
>> > Email: pieter.degraeuwe@systemworks.be
>> > visit us at http://www.systemworks.be
>> >
>>
>> ---------------------------------------------------------------------
>> 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: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by VGJ <za...@gmail.com>.
I'm not injecting it directly. I'm using a "proxy" class to get a reference
to the stateless bean's interface like so:
public class CartProxy
{
private static ShoppingCartLocal lookupCartInterface()
{
ShoppingCartLocal cart = null;
try
{
InitialContext ctx = new InitialContext();
cart =
(ShoppingCartLocal)ctx.lookup("java:comp/env/ShoppingCartBean");
}
catch (NamingException exp)
{
LogProxy.saveEntry(exp);
}
return cart;
}
}
The reference in web.xml makes this possible:
<ejb-local-ref>
<ejb-ref-name>ShoppingCartBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.myapp.session.ShoppingCartLocal</local>
<ejb-link>MyProjectEJB.jar#ShoppingCartBean</ejb-link>
</ejb-local-ref>
Is this not supposed to work? It's been in production for over 3 yrs...so I
hope it does! :)
The entire app is built this way and this one page is the only one throwing
this exception. It works, it doesn't stop the show or affect anything
negatively, so far as I can tell. I would just like to get rid of it and
figure out what it is.
Thanks again,
-v
On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg <ig...@gmail.com>wrote:
> wicket stuff contains a wicket-jee module which supports injecting ejb
> beans into wicket components the same way that wicket-spring injects
> wicket beans.
>
> -igor
>
> On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
> <pi...@systemworks.be> wrote:
> > Your cart has a reference to the sessionBean ShopingCart. This is not
> > allowed, however. The IOC incjectionsupport makes this possible by
> wrapping
> > this EJB reference with a serializable proxy.
> >
> > I only have expecience with wicket-spring end it works great. (In your
> case,
> > define your ejb reference in spring and inject it via wicket-spring
> support
> > in your page.
> > problem solved!
> >
> > Pieter
> >
> > On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com> wrote:
> >
> >> 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
> >>
> >
> >
> >
> > --
> > Pieter Degraeuwe
> > Systemworks bvba
> > Belgiëlaan 61
> > 9070 Destelbergen
> > GSM: +32 (0)485/68.60.85
> > Email: pieter.degraeuwe@systemworks.be
> > visit us at http://www.systemworks.be
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by Igor Vaynberg <ig...@gmail.com>.
wicket stuff contains a wicket-jee module which supports injecting ejb
beans into wicket components the same way that wicket-spring injects
wicket beans.
-igor
On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
<pi...@systemworks.be> wrote:
> Your cart has a reference to the sessionBean ShopingCart. This is not
> allowed, however. The IOC incjectionsupport makes this possible by wrapping
> this EJB reference with a serializable proxy.
>
> I only have expecience with wicket-spring end it works great. (In your case,
> define your ejb reference in spring and inject it via wicket-spring support
> in your page.
> problem solved!
>
> Pieter
>
> On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com> wrote:
>
>> 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
>>
>
>
>
> --
> Pieter Degraeuwe
> Systemworks bvba
> Belgiëlaan 61
> 9070 Destelbergen
> GSM: +32 (0)485/68.60.85
> Email: pieter.degraeuwe@systemworks.be
> visit us at http://www.systemworks.be
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException
Posted by Pieter Degraeuwe <pi...@systemworks.be>.
Your cart has a reference to the sessionBean ShopingCart. This is not
allowed, however. The IOC incjectionsupport makes this possible by wrapping
this EJB reference with a serializable proxy.
I only have expecience with wicket-spring end it works great. (In your case,
define your ejb reference in spring and inject it via wicket-spring support
in your page.
problem solved!
Pieter
On Wed, Nov 18, 2009 at 10:50 PM, VGJ <za...@gmail.com> wrote:
> 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
>
--
Pieter Degraeuwe
Systemworks bvba
Belgiëlaan 61
9070 Destelbergen
GSM: +32 (0)485/68.60.85
Email: pieter.degraeuwe@systemworks.be
visit us at http://www.systemworks.be