users@glassfish.java.net

Re: Injected EJB proxy not serializable

From: <forums_at_java.net>
Date: Tue, 29 Nov 2011 03:40:49 -0600 (CST)

I am encountering the same problem. I am developing  a JSF 2 application
and injectig a Local EJB into a View Scoped Bean. The application is using
client side state saving. My EJB is serializable and my server is Glassfish
3.1.1. A beans.xml fiel is present in both the EJB module jar and the
webapplications war. The EJB is annotated with @Named, @Stateless and
@LocalBean and the injection is preformed via @Inject.

The full stacktrace is:

java.io.NotSerializableException:
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:413)
    at
org.jboss.weld.bean.proxy.util.SerializableProxy.writeObject(SerializableProxy.java:92)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    at java.util.ArrayList.writeObject(ArrayList.java:710)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:438)
    at
java.util.Collections$SynchronizedCollection.writeObject(Collections.java:1659)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    at
java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1454)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    at java.util.HashMap.writeObject(HashMap.java:1014)
    at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    at java.util.HashMap.writeObject(HashMap.java:1014)
    at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
    at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
    at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    at
com.sun.faces.renderkit.ClientSideStateHelper.doWriteState(ClientSideStateHelper.java:325)
    at
com.sun.faces.renderkit.ClientSideStateHelper.writeState(ClientSideStateHelper.java:173)
    at
com.sun.faces.renderkit.ResponseStateManagerImpl.writeState(ResponseStateManagerImpl.java:122)
    at
com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:166)
    at
com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)
    at
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:418)
    at
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    at
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
    at
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
    at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
    at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
    at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
    at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at
com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)


--
[Message sent by forum member 'Puls']
View Post: http://forums.java.net/node/865022