users@glassfish.java.net

Re: Injected EJB proxy not serializable

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Thu, 17 Nov 2011 14:58:16 -0800

Local EJB does not need to be serializable. The bug was fixed in Weld -
are you using CDI?

thanks,
-marina

forums_at_java.net wrote:
> I'm injecting SLSBs in a Wicket project using wicket-cdi [1] and I'm
> running into issues with the Glassfish generated EJB proxy not being
> serializable.
> The problem looks the same as GLASSFISH-12599 [2] but this is
> indicated as
> having been resolved.
>
> I get the exception below when Wicket tries to serialize the
> proxy. Should EJBLocalObjectInvocationHandlerDelegate be serializable? is
> this a regression?
>
> <code>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] </code>
>
>
>
> [1] https://github.com/42Lines/wicket-cdi
> [2] http://java.net/jira/browse/GLASSFISH-12599
>
> --
>
> [Message sent by forum member 'buddypine']
>
> View Post: http://forums.java.net/node/865022
>
>