well, i recently wrote a wicket-ioc module for seam and it took me a
couple of hours :)

-igor

On Fri, Jul 9, 2010 at 12:52 AM, Harald Wellmann
<harald.wellm...@multi-m.de> wrote:
> Ok, I see what you mean and I think that would work. Only I'm not so sure 
> about the "couple of hours" (have you looked at CDI BeanManager...?) and with 
> that approach, I would end up having 3 proxies between my Wicket component 
> and my EJB.
>
> Anyway, this is probably faster to implement than waiting for a solution from 
> Glassfish...
>
> Best regards,
> Harald
>
>
> -----Ursprüngliche Nachricht-----
> Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
> Gesendet: Donnerstag, 8. Juli 2010 21:45
> An: users@wicket.apache.org
> Betreff: Re: AW: Serialization of injected EJBs
>
> hrm, if thats the case you can always use wicket-ioc module to build
> the proxy yourself just like we do for spring and guice, it should
> only be a couple of hours effort.
>
> -igor
>
> On Thu, Jul 8, 2010 at 10:34 AM, Harald Wellmann
> <harald.wellm...@multi-m.de> wrote:
>> In theory, yes...
>>
>> The proxies returned by Weld 1.0.1.SP3 (the version used in Glassfish 3.0.1) 
>> are serializable, but after serializing and deserializing the proxy, the 
>> method handler is broken and you get a null pointer exception when invoking 
>> any method of the proxy. i verified this in a simple test case, independent 
>> of Wicket. This looks like the problem fixed in 
>> https://jira.jboss.org/browse/JASSIST-97, though I'm not fully sure that 
>> this is exactly the same issue.
>>
>> Anyway, I patched my Glassfish version with the most recent release of 
>> Javassist containing the bugfix. With this fix, I already get a 
>> NotSerializableException from Wicket when the current page is about to be 
>> moved to the page store:
>>
>>   protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h 
>> [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate] 
>> <----- field that is not serializable
>>
>> It seems that the stateless session bean implementation is wrapped in at 
>> least two proxies, one generated by Glassfish (for getting the session bean 
>> into the CDI context, equivalent to @EJB injection) and another one, 
>> generated by Weld using Javassist, filling the @Inject injection point in my 
>> Wicket component. The outer proxy is ok with the newer Javassist version, 
>> but the inner proxy simply is not serializable because of 
>> EJBLocalObjectInvocationHandlerDelegate.
>>
>> Using @EJB instead of @Inject, I just get the inner proxy, with the same 
>> problem caused by EJBLocalObjectInvocationHandlerDelegate.
>>
>> So my impression is that Glassfish simply breaks the contract of my 
>> serializable session bean interface. On the other hand, I wouldn't be 
>> surprised if there was a paragraph somewhere in the Java EE specs stating 
>> that EJBs shall not be serialized by the application (i.e. Wicket) because 
>> the container takes care of passivation anyway...
>>
>> Has anybody tried Wicket+CDI+EJB on other app servers? (There aren't so many 
>> supporting Java EE 6....)
>>
>> Regards,
>> Harald
>>
>>
>> ________________________________________
>> Von: Igor Vaynberg [igor.vaynb...@gmail.com]
>> Gesendet: Donnerstag, 8. Juli 2010 17:54
>> An: users@wicket.apache.org
>> Betreff: Re: AW: Serialization of injected EJBs
>>
>> im not sure if this is in a CDI spec or not, but afaik Weld will
>> return serializable proxies when you manually inject objects. so that
>> should work out of the box.
>>
>> -igor
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

Reply via email to