4 Replies Latest reply on Aug 15, 2007 1:29 AM by leon qian

    Exception thrown on Stateful Session Bean lifecycle

    Sverker Abrahamsson Novice

      I keep on getting stacktraces as below:

      12:22:58,152 WARN [Contexts] Could not destroy component: callHandler
      java.lang.RuntimeException: java.io.IOException
       at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptor
      s(StatefulBeanContext.java:809)
       at org.jboss.ejb3.stateful.StatefulBeanContext.getInstance(StatefulBeanC
      ontext.java:740)
       at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:6
      2)
       at org.jboss.ejb3.stateful.StatefulContainer.invokePostActivate(Stateful
      Container.java:397)
       at org.jboss.ejb3.stateful.StatefulBeanContext.postActivate(StatefulBean
      Context.java:381)
       at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.act
      ivateSession(StatefulSessionFilePersistenceManager.java:316)
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCac
      he.java:387)
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCac
      he.java:375)
       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulIn
      stanceInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:101)
       at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemo
      veInterceptor.java:97)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
      ationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth
      enticationInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
      ptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
      usInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:101)
       at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContain
      er.java:204)
       at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.
      java:100)
       at $Proxy216.destroy(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocation
      Context.java:31)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideIn
      terceptor.java:72)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
      Context.java:57)
       at org.jboss.seam.interceptors.SecurityInterceptor.aroundInvoke(Security
      Interceptor.java:37)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
      Context.java:69)
       at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInte
      rceptor.java:40)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
      Context.java:69)
       at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(S
      ynchronizationInterceptor.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
      Context.java:69)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
      103)
       at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInter
      ceptor.java:50)
       at org.javassist.tmp.java.lang.Object_$$_javassist_21.destroy(Object_$$_
      javassist_21.java)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
       at org.jboss.seam.Component.callDestroyMethod(Component.java:1765)
       at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:231)
       at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:297)
       at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.jav
      a:45)
       at org.apache.catalina.session.StandardSession.expire(StandardSession.ja
      va:702)
       at org.apache.catalina.session.StandardSession.isValid(StandardSession.j
      ava:592)
       at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.ja
      va:682)
       at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase
      .java:667)
       at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBas
      e.java:1286)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
      rocessChildren(ContainerBase.java:1571)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
      rocessChildren(ContainerBase.java:1580)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
      rocessChildren(ContainerBase.java:1580)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.r
      un(ContainerBase.java:1560)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.io.IOException
       at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(
      RegularObjectPersister.java:107)
       at org.jboss.serial.persister.RegularObjectPersister.defaultRead(Regular
      ObjectPersister.java:269)
       at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObj
      ectPersister.java:241)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDe
      scriptionFromStreaming(ObjectDescriptorFactory.java:412)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDe
      scription(ObjectDescriptorFactory.java:82)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInp
      ut.readObject(DataContainer.java:643)
       at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(
      RegularObjectPersister.java:353)
       at org.jboss.serial.persister.RegularObjectPersister.defaultRead(Regular
      ObjectPersister.java:273)
       at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObj
      ectPersister.java:241)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDe
      scriptionFromStreaming(ObjectDescriptorFactory.java:412)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDe
      scription(ObjectDescriptorFactory.java:82)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInp
      ut.readObject(DataContainer.java:643)
       at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(
      RegularObjectPersister.java:353)
       at org.jboss.serial.persister.RegularObjectPersister.defaultRead(Regular
      ObjectPersister.java:273)
       at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObj
      ectPersister.java:241)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDe
      scriptionFromStreaming(ObjectDescriptorFactory.java:412)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDe
      scription(ObjectDescriptorFactory.java:82)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInp
      ut.readObject(DataContainer.java:643)
       at org.jboss.serial.persister.ArrayPersister.readObjectArray(ArrayPersis
      ter.java:196)
       at org.jboss.serial.persister.ArrayPersister.readData(ArrayPersister.jav
      a:172)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDe
      scriptionFromStreaming(ObjectDescriptorFactory.java:412)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDe
      scription(ObjectDescriptorFactory.java:82)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInp
      ut.readObject(DataContainer.java:643)
       at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride(JBossOb
      jectInputStream.java:163)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:333)
       at org.jboss.serial.io.MarshalledObject.get(MarshalledObject.java:68)
       at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptor
      s(StatefulBeanContext.java:780)
       ... 59 more
      Caused by: java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(
      RegularObjectPersister.java:103)
       ... 85 more
      Caused by: org.jboss.serial.exception.SerializationException: Could not create i
      nstance of se.sodermalmskyrkan.callcenter.CallHandlerActionBean$1 - se.sodermalm
      skyrkan.callcenter.CallHandlerActionBean$1
       at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaDa
      ta.java:342)
       at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObj
      ectPersister.java:239)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDe
      scriptionFromStreaming(ObjectDescriptorFactory.java:412)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDe
      scription(ObjectDescriptorFactory.java:82)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInp
      ut.readObject(DataContainer.java:643)
       at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(
      RegularObjectPersister.java:353)
       at org.jboss.serial.persister.ObjectInputStreamProxy.defaultReadObject(O
      bjectInputStreamProxy.java:78)
       at java.util.PriorityQueue.readObject(PriorityQueue.java:638)
       ... 90 more
      Caused by: java.lang.InstantiationException: se.sodermalmskyrkan.callcenter.Call
      HandlerActionBean$1
       at java.lang.Class.newInstance0(Class.java:335)
       at java.lang.Class.newInstance(Class.java:303)
       at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaDa
      ta.java:334)
       ... 97 more
      


      These seam to occur after some time of inactivity, on my test system it happens after about 1 hour but in the live system it can happen already after 5-10 minutes causing the application to fail.

      What can be the reason? I saw some suggestion on a similar case that the bean would have an atttribute which isn't Serializable but all my attributes are Serializable as far as I can find.