You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Phill <ph...@leadseeker.co.uk> on 2011/11/16 09:52:54 UTC

wicket-cdi NotSerializableException for injected SLSB proxy

I'm using the wicket-cdi module (https://github.com/42Lines/wicket-cdi) to inject an SLSB with Glassfish 3.1.1

MyWebApplication.init()

BeanManager  manager = (BeanManager) ic.lookup("java:comp/BeanManager");
new CdiConfiguration(manager)
        .setPropagation(ConversationPropagation.NONBOOKMARKABLE)
        .configure(this);

public class DashboardPage extends AuthorisedBasePage {
    @Inject
    private AccountingService accountingService;
…
}

Injection is working fine and I can use the session bean but Wicket is unable to serialize the proxy.
According to my research previous issues with the Weld proxy not being serializable should have been resolved in the version that shipped with GF 3.1.
I've also tried the latest GF 3.1.2 promoted build which uses Weld 1.1.3 and I get the same problem.

I'm not really sure if this is a Wicket issue or whether I should be taking it up with the Weld team.. any pointers appreciated.


2011-11-16 09:05:17,201 [http-thread-pool-8181(4)] ERROR org.apache.wicket.serialize.java.JavaSerializer - Error serializing object class uk.co.leadseeker.webapp.user.DashboardPage [object=[Page class = uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]]
java.io.NotSerializableException: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:397) ~[na:1.6.0_29]
	at org.jboss.weld.bean.proxy.util.SerializableProxy.writeObject(SerializableProxy.java:92) ~[weld-osgi-bundle.jar:20110404-1554]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_29]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_29]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_29]
	at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) ~[na:1.6.0_29]
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) ~[na:1.6.0_29]
	at org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:77) ~[wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:368) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:146) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:383) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:171) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:94) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.page.PageAccessSynchronizer$2.commitRequest(PageAccessSynchronizer.java:281) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.Application$2.onDetach(Application.java:1588) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:99) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:97) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.util.listener.ListenerCollection$1.notify(ListenerCollection.java:119) [wicket-util-1.5.3.jar:1.5.3]
	at org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:143) [wicket-util-1.5.3.jar:1.5.3]
	at org.apache.wicket.util.listener.ListenerCollection.reversedNotifyIgnoringExceptions(ListenerCollection.java:113) [wicket-util-1.5.3.jar:1.5.3]
	at org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:95) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:569) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:508) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:284) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218) [wicket-core-1.5.3.jar:1.5.3]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) [web-core.jar:3.1.1]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217) [web-core.jar:3.1.1]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) [web-core.jar:3.1.1]
	at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:175) [web-core.jar:3.1.1]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java) [web-core.jar:3.1.1]
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) [web-core.jar:3.1.1]
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) [web-core.jar:3.1.1]
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98) [web-glue.jar:3.1.1]
	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91) [web-glue.jar:3.1.1]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) [web-core.jar:3.1.1]
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330) [web-core.jar:3.1.1]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231) [web-core.jar:3.1.1]
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174) [kernel.jar:3.1.1]
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828) [grizzly-http.jar:1.9.36]
	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725) [grizzly-http.jar:1.9.36]
	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019) [grizzly-http.jar:1.9.36]
	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) [grizzly-http.jar:1.9.36]
	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) [grizzly-framework.jar:1.9.36]
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) [grizzly-framework.jar:1.9.36]
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) [grizzly-framework.jar:1.9.36]
	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) [grizzly-http.jar:1.9.36]
	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) [grizzly-framework.jar:1.9.36]
	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) [grizzly-framework.jar:1.9.36]
	at com.sun.grizzly.ContextTask.run(ContextTask.java:71) [grizzly-framework.jar:1.9.36]
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) [grizzly-utils.jar:1.9.36]
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) [grizzly-utils.jar:1.9.36]
	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]
2011-11-16 09:05:17,205 [http-thread-pool-8181(4)] WARN  org.apache.wicket.pageStore.DefaultPageStore - Page [Page class = uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1] cannot be serialized. See previous logs for possible reasons.

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


Re: wicket-cdi NotSerializableException for injected SLSB proxy

Posted by Igor Vaynberg <ig...@gmail.com>.
On Thu, Nov 24, 2011 at 4:03 AM, Phill <ph...@leadseeker.co.uk> wrote:
> On further investigation it doesn't seem to be a weld/glassfish bug as as far as I can tell there is no requirement for a Stateless EJB proxy to be serializable.
> The issue was raised here where a patch to seam-wicket was proposed:
> https://issues.jboss.org/browse/SEAMWICKET-41
> Any chance of a similar workaround for wicket-cdi?

i will take a look...

> Interestingly if I inject the @Stateless EJB into an @ApplicationScoped bean and then inject the application scoped bean into my page there are no serialization issues, suggesting that in this case the proxy for the SLSB is serializable.

no. the proxy to the application scoped bean is serializable so the
proxy to the slsb is never serialized. this might be a way to go,
creating applicationscoped wrappers for your slsbs...

-igor

> -Phill
>
>
> On 16/nov/2011, at 17:24, Igor Vaynberg wrote:
>
>> looks like a weld/glassfish bug, especially since other kinds of proxies
>> (even for application-scoped objects) are serializable.
>>
>> -igor
>>
>> On Wed, Nov 16, 2011 at 12:52 AM, Phill <ph...@leadseeker.co.uk> wrote:
>>
>>> I'm using the wicket-cdi module (https://github.com/42Lines/wicket-cdi)
>>> to inject an SLSB with Glassfish 3.1.1
>>>
>>> MyWebApplication.init()
>>>
>>> BeanManager  manager = (BeanManager) ic.lookup("java:comp/BeanManager");
>>> new CdiConfiguration(manager)
>>>       .setPropagation(ConversationPropagation.NONBOOKMARKABLE)
>>>       .configure(this);
>>>
>>> public class DashboardPage extends AuthorisedBasePage {
>>>   @Inject
>>>   private AccountingService accountingService;
>>> …
>>> }
>>>
>>> Injection is working fine and I can use the session bean but Wicket is
>>> unable to serialize the proxy.
>>> According to my research previous issues with the Weld proxy not being
>>> serializable should have been resolved in the version that shipped with GF
>>> 3.1.
>>> I've also tried the latest GF 3.1.2 promoted build which uses Weld 1.1.3
>>> and I get the same problem.
>>>
>>> I'm not really sure if this is a Wicket issue or whether I should be
>>> taking it up with the Weld team.. any pointers appreciated.
>>>
>>>
>>> 2011-11-16 09:05:17,201 [http-thread-pool-8181(4)] ERROR
>>> org.apache.wicket.serialize.java.JavaSerializer - Error serializing object
>>> class uk.co.leadseeker.webapp.user.DashboardPage [object=[Page class =
>>> uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]]
>>> java.io.NotSerializableException
>
> ---------------------------------------------------------------------
> 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-cdi NotSerializableException for injected SLSB proxy

Posted by Phill <ph...@leadseeker.co.uk>.
https://github.com/42Lines/wicket-cdi/issues/14

On 24/nov/2011, at 17:19, Igor Vaynberg wrote:

> btw, feel free to open an issue in wicket-cdi
> 
> -igor
> 
> On Thu, Nov 24, 2011 at 4:03 AM, Phill <ph...@leadseeker.co.uk> wrote:
>> On further investigation it doesn't seem to be a weld/glassfish bug as as far as I can tell there is no requirement for a Stateless EJB proxy to be serializable.
>> The issue was raised here where a patch to seam-wicket was proposed:
>> https://issues.jboss.org/browse/SEAMWICKET-41
>> Any chance of a similar workaround for wicket-cdi?
>> 
>> Interestingly if I inject the @Stateless EJB into an @ApplicationScoped bean and then inject the application scoped bean into my page there are no serialization issues, suggesting that in this case the proxy for the SLSB is serializable.
>> -Phill
>> 
>> 
>> On 16/nov/2011, at 17:24, Igor Vaynberg wrote:
>> 
>>> looks like a weld/glassfish bug, especially since other kinds of proxies
>>> (even for application-scoped objects) are serializable.
>>> 
>>> -igor
>>> 
>>> On Wed, Nov 16, 2011 at 12:52 AM, Phill <ph...@leadseeker.co.uk> wrote:
>>> 
>>>> I'm using the wicket-cdi module (https://github.com/42Lines/wicket-cdi)
>>>> to inject an SLSB with Glassfish 3.1.1
>>>> 
>>>> MyWebApplication.init()
>>>> 
>>>> BeanManager  manager = (BeanManager) ic.lookup("java:comp/BeanManager");
>>>> new CdiConfiguration(manager)
>>>>       .setPropagation(ConversationPropagation.NONBOOKMARKABLE)
>>>>       .configure(this);
>>>> 
>>>> public class DashboardPage extends AuthorisedBasePage {
>>>>   @Inject
>>>>   private AccountingService accountingService;
>>>> …
>>>> }
>>>> 
>>>> Injection is working fine and I can use the session bean but Wicket is
>>>> unable to serialize the proxy.
>>>> According to my research previous issues with the Weld proxy not being
>>>> serializable should have been resolved in the version that shipped with GF
>>>> 3.1.
>>>> I've also tried the latest GF 3.1.2 promoted build which uses Weld 1.1.3
>>>> and I get the same problem.
>>>> 
>>>> I'm not really sure if this is a Wicket issue or whether I should be
>>>> taking it up with the Weld team.. any pointers appreciated.
>>>> 
>>>> 
>>>> 2011-11-16 09:05:17,201 [http-thread-pool-8181(4)] ERROR
>>>> org.apache.wicket.serialize.java.JavaSerializer - Error serializing object
>>>> class uk.co.leadseeker.webapp.user.DashboardPage [object=[Page class =
>>>> uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]]
>>>> java.io.NotSerializableException
>> 
>> ---------------------------------------------------------------------
>> 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-cdi NotSerializableException for injected SLSB proxy

Posted by Igor Vaynberg <ig...@gmail.com>.
btw, feel free to open an issue in wicket-cdi

-igor

On Thu, Nov 24, 2011 at 4:03 AM, Phill <ph...@leadseeker.co.uk> wrote:
> On further investigation it doesn't seem to be a weld/glassfish bug as as far as I can tell there is no requirement for a Stateless EJB proxy to be serializable.
> The issue was raised here where a patch to seam-wicket was proposed:
> https://issues.jboss.org/browse/SEAMWICKET-41
> Any chance of a similar workaround for wicket-cdi?
>
> Interestingly if I inject the @Stateless EJB into an @ApplicationScoped bean and then inject the application scoped bean into my page there are no serialization issues, suggesting that in this case the proxy for the SLSB is serializable.
> -Phill
>
>
> On 16/nov/2011, at 17:24, Igor Vaynberg wrote:
>
>> looks like a weld/glassfish bug, especially since other kinds of proxies
>> (even for application-scoped objects) are serializable.
>>
>> -igor
>>
>> On Wed, Nov 16, 2011 at 12:52 AM, Phill <ph...@leadseeker.co.uk> wrote:
>>
>>> I'm using the wicket-cdi module (https://github.com/42Lines/wicket-cdi)
>>> to inject an SLSB with Glassfish 3.1.1
>>>
>>> MyWebApplication.init()
>>>
>>> BeanManager  manager = (BeanManager) ic.lookup("java:comp/BeanManager");
>>> new CdiConfiguration(manager)
>>>       .setPropagation(ConversationPropagation.NONBOOKMARKABLE)
>>>       .configure(this);
>>>
>>> public class DashboardPage extends AuthorisedBasePage {
>>>   @Inject
>>>   private AccountingService accountingService;
>>> …
>>> }
>>>
>>> Injection is working fine and I can use the session bean but Wicket is
>>> unable to serialize the proxy.
>>> According to my research previous issues with the Weld proxy not being
>>> serializable should have been resolved in the version that shipped with GF
>>> 3.1.
>>> I've also tried the latest GF 3.1.2 promoted build which uses Weld 1.1.3
>>> and I get the same problem.
>>>
>>> I'm not really sure if this is a Wicket issue or whether I should be
>>> taking it up with the Weld team.. any pointers appreciated.
>>>
>>>
>>> 2011-11-16 09:05:17,201 [http-thread-pool-8181(4)] ERROR
>>> org.apache.wicket.serialize.java.JavaSerializer - Error serializing object
>>> class uk.co.leadseeker.webapp.user.DashboardPage [object=[Page class =
>>> uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]]
>>> java.io.NotSerializableException
>
> ---------------------------------------------------------------------
> 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-cdi NotSerializableException for injected SLSB proxy

Posted by Phill <ph...@leadseeker.co.uk>.
On further investigation it doesn't seem to be a weld/glassfish bug as as far as I can tell there is no requirement for a Stateless EJB proxy to be serializable.
The issue was raised here where a patch to seam-wicket was proposed:
https://issues.jboss.org/browse/SEAMWICKET-41
Any chance of a similar workaround for wicket-cdi? 

Interestingly if I inject the @Stateless EJB into an @ApplicationScoped bean and then inject the application scoped bean into my page there are no serialization issues, suggesting that in this case the proxy for the SLSB is serializable.
-Phill


On 16/nov/2011, at 17:24, Igor Vaynberg wrote:

> looks like a weld/glassfish bug, especially since other kinds of proxies
> (even for application-scoped objects) are serializable.
> 
> -igor
> 
> On Wed, Nov 16, 2011 at 12:52 AM, Phill <ph...@leadseeker.co.uk> wrote:
> 
>> I'm using the wicket-cdi module (https://github.com/42Lines/wicket-cdi)
>> to inject an SLSB with Glassfish 3.1.1
>> 
>> MyWebApplication.init()
>> 
>> BeanManager  manager = (BeanManager) ic.lookup("java:comp/BeanManager");
>> new CdiConfiguration(manager)
>>       .setPropagation(ConversationPropagation.NONBOOKMARKABLE)
>>       .configure(this);
>> 
>> public class DashboardPage extends AuthorisedBasePage {
>>   @Inject
>>   private AccountingService accountingService;
>> …
>> }
>> 
>> Injection is working fine and I can use the session bean but Wicket is
>> unable to serialize the proxy.
>> According to my research previous issues with the Weld proxy not being
>> serializable should have been resolved in the version that shipped with GF
>> 3.1.
>> I've also tried the latest GF 3.1.2 promoted build which uses Weld 1.1.3
>> and I get the same problem.
>> 
>> I'm not really sure if this is a Wicket issue or whether I should be
>> taking it up with the Weld team.. any pointers appreciated.
>> 
>> 
>> 2011-11-16 09:05:17,201 [http-thread-pool-8181(4)] ERROR
>> org.apache.wicket.serialize.java.JavaSerializer - Error serializing object
>> class uk.co.leadseeker.webapp.user.DashboardPage [object=[Page class =
>> uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]]
>> java.io.NotSerializableException

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


Re: wicket-cdi NotSerializableException for injected SLSB proxy

Posted by Igor Vaynberg <ig...@gmail.com>.
looks like a weld/glassfish bug, especially since other kinds of proxies
(even for application-scoped objects) are serializable.

-igor

On Wed, Nov 16, 2011 at 12:52 AM, Phill <ph...@leadseeker.co.uk> wrote:

> I'm using the wicket-cdi module (https://github.com/42Lines/wicket-cdi)
> to inject an SLSB with Glassfish 3.1.1
>
> MyWebApplication.init()
>
> BeanManager  manager = (BeanManager) ic.lookup("java:comp/BeanManager");
> new CdiConfiguration(manager)
>        .setPropagation(ConversationPropagation.NONBOOKMARKABLE)
>        .configure(this);
>
> public class DashboardPage extends AuthorisedBasePage {
>    @Inject
>    private AccountingService accountingService;
> …
> }
>
> Injection is working fine and I can use the session bean but Wicket is
> unable to serialize the proxy.
> According to my research previous issues with the Weld proxy not being
> serializable should have been resolved in the version that shipped with GF
> 3.1.
> I've also tried the latest GF 3.1.2 promoted build which uses Weld 1.1.3
> and I get the same problem.
>
> I'm not really sure if this is a Wicket issue or whether I should be
> taking it up with the Weld team.. any pointers appreciated.
>
>
> 2011-11-16 09:05:17,201 [http-thread-pool-8181(4)] ERROR
> org.apache.wicket.serialize.java.JavaSerializer - Error serializing object
> class uk.co.leadseeker.webapp.user.DashboardPage [object=[Page class =
> uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]]
> java.io.NotSerializableException:
> com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:397)
> ~[na:1.6.0_29]
>        at
> org.jboss.weld.bean.proxy.util.SerializableProxy.writeObject(SerializableProxy.java:92)
> ~[weld-osgi-bundle.jar:20110404-1554]
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[na:1.6.0_29]
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> ~[na:1.6.0_29]
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> ~[na:1.6.0_29]
>        at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
>        at
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>        at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
> ~[na:1.6.0_29]
>        at
> org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:77)
> ~[wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:368)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:146)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:383)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:171)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:94)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.page.PageAccessSynchronizer$2.commitRequest(PageAccessSynchronizer.java:281)
> [wicket-core-1.5.3.jar:1.5.3]
>        at org.apache.wicket.Application$2.onDetach(Application.java:1588)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:99)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.request.cycle.RequestCycleListenerCollection$3.notify(RequestCycleListenerCollection.java:97)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.util.listener.ListenerCollection$1.notify(ListenerCollection.java:119)
> [wicket-util-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.util.listener.ListenerCollection.reversedNotify(ListenerCollection.java:143)
> [wicket-util-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.util.listener.ListenerCollection.reversedNotifyIgnoringExceptions(ListenerCollection.java:113)
> [wicket-util-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:95)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:569)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:508)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:284)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
> [wicket-core-1.5.3.jar:1.5.3]
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
> [web-core.jar:3.1.1]
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
> [web-core.jar:3.1.1]
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
> [web-core.jar:3.1.1]
>        at
> org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:175)
> [web-core.jar:3.1.1]
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
> [web-core.jar:3.1.1]
>        at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
> [web-core.jar:3.1.1]
>        at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
> [web-core.jar:3.1.1]
>        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
> [web-glue.jar:3.1.1]
>        at
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
> [web-glue.jar:3.1.1]
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
> [web-core.jar:3.1.1]
>        at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
> [web-core.jar:3.1.1]
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
> [web-core.jar:3.1.1]
>        at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
> [kernel.jar:3.1.1]
>        at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
> [grizzly-http.jar:1.9.36]
>        at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
> [grizzly-http.jar:1.9.36]
>        at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
> [grizzly-http.jar:1.9.36]
>        at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
> [grizzly-http.jar:1.9.36]
>        at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> [grizzly-framework.jar:1.9.36]
>        at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> [grizzly-framework.jar:1.9.36]
>        at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> [grizzly-framework.jar:1.9.36]
>        at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> [grizzly-http.jar:1.9.36]
>        at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> [grizzly-framework.jar:1.9.36]
>        at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> [grizzly-framework.jar:1.9.36]
>        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> [grizzly-framework.jar:1.9.36]
>        at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> [grizzly-utils.jar:1.9.36]
>        at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> [grizzly-utils.jar:1.9.36]
>        at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]
> 2011-11-16 09:05:17,205 [http-thread-pool-8181(4)] WARN
>  org.apache.wicket.pageStore.DefaultPageStore - Page [Page class =
> uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]
> cannot be serialized. See previous logs for possible reasons.
>
> Phill
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>