Hmmm, has anybody tried this on Glassfish? The exception I currently get is:
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate] <----- field that is not serializable So it seems it's not the proxy itself that cannot be serialized but some delegate generated by Glassfish which is not serializable (even though my implementation class is). Regards, Harald -----Ursprüngliche Nachricht----- Von: Major Péter [mailto:[email protected]] Gesendet: Mittwoch, 7. Juli 2010 17:12 An: [email protected] Betreff: Re: AW: Serialization of injected EJBs JavaEE Inject generates a serializable proxy, so the injected references could be stored into session without problem. Peter 2010-07-07 17:07 keltezéssel, Harald Wellmann írta: > Is there any evidence that javaee-inject would solve the problem? The > question is not how to inject the EJBs (this works fine with the wicket-cdi > lib), but how to serialize the injected proxies. > > Regards, > > Harald > > -----Ursprüngliche Nachricht----- > Von: Major Péter [mailto:[email protected]] > Gesendet: Mittwoch, 7. Juli 2010 16:51 > An: [email protected] > Betreff: Re: Serialization of injected EJBs > > Hi, > > you could try to use: > http://wicketstuff.org/confluence/display/STUFFWIKI/JavaEE+Inject > > Regards, > Peter > > 2010-07-07 16:42 keltezéssel, Harald Wellmann írta: >> I'm using Wicket on Glassfish v3, injecting stateless session beans (using >> the no-interface view) into my Wicket components. >> >> For a component member >> >> @Inject >> private Foo foo; >> >> Glassfish generates a proxy which is not serializable, even though my class >> Foo is. >> >> Now the problem is that Wicket cannot serialize the page containing the >> given component. I'm not sure whether or not it is legal by the EJB 3.1 spec >> to have the proxy being not serializable when the underlying class is. Just >> assuming for the moment this is not a bug in Glassfish, what would be the >> best way of dealing with this in Wicket? >> >> Detaching the EJBs on serialization and re-injecting them on deserialization >> might work, but I'm not sure how to do this, and of course I would like that >> to happen behind the scenes, without having to provide event handlers in >> each and every component with injected EJBs. >> >> By the way, I'm using a ComponentInstantiationListener from >> https://wamblee.org/viewvc/wicket-cdi/ to deal with CDI, but the same issue >> occurs with old style @EJB injection as well. >> >> Any ideas? >> >> Best regards, >> >> Harald --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
