1 Reply Latest reply on Jun 18, 2009 1:51 PM by Waldo Nell

    NullPointerException restoring EJB state

    Waldo Nell Newbie

      Why do I get this error randomly? This is on a Stateful session bean:

      2009-06-18 18:57:46,939 INFO [STDOUT] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) In destroy...

      2009-06-18 18:57:46,951 WARN [org.jboss.seam.Component] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Exception calling component @Destroy method: search

      javax.ejb.EJBException: Could not activate; failed to restore state
      at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:318)
      at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:476)
      at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:430)
      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:59)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:100)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:154)
      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
      at $Proxy1164.destroy(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
      at org.javassist.tmp.java.lang.Object_$$_javassist_8.destroy(Object_$$_javassist_8.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
      at org.jboss.seam.Component.destroy(Component.java:1436)
      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
      at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:267)
      at org.jboss.seam.contexts.ServletLifecycle.endSession(ServletLifecycle.java:146)
      at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:58)
      at org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
      at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
      at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:682)
      at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667)
      at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1327)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1612)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1621)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1621)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1601)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.io.EOFException
      at java.io.DataInputStream.readByte(DataInputStream.java:243)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readByte(DataContainer.java:716)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:64)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
      at org.jboss.ejb3.stateful.StatefulBeanContext.readExternal(StatefulBeanContext.java:972)
      at org.jboss.serial.persister.ExternalizePersister.readData(ExternalizePersister.java:72)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
      at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride(JBossObjectInputStream.java:163)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342)
      at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:304)
      ... 65 more

      Here is the bean:

      @Stateful
      @Scope(ScopeType.SESSION)
      @Name("custTransactionManager")
      public class CustAccountTransactionManagerBean implements CustAccountTransactionManager {

      public CustAccountTransactionManagerBean() {
      }

      @Factory("custTransactionList")
      public void loadTransactions() {
      // some code
      }

      @Remove
      @Destroy
      public void destroy() {
      System.out.println("In destroy...");
      }

      }