2 Replies Latest reply on Feb 24, 2006 11:48 AM by Annegret Sternagel

    JBoss hangs using staeful session bean to read data

    Annegret Sternagel Newbie

      Hi,

      I have a weard problem that JBoss hangs.

      JBoss configuration:
      JBoss 4.0.3SP1 + EJB3 RC2 (JBoss installer) on WindowsXP
      JDK 1.5.0_05

      if I read data using the EntityManager in a stateful sessionbean (EJB3) the data are returned, but after a short while (about 30 - 60 sec) JBoss hangs and javaw.exe uses 100% processor time

      I've tested serveral configurations:
      1. the data are cached in the session bean and returned to the client
      => JBoss hangs after a while
      2. the data are only returned but not cached
      => first read ok, but in second read JBoss hangs, no data returned
      3. using a stateless session bean
      => this works

      But we must use a stateful session bean otherwise we would have to change to much exsiting code.

      Any idea ?
      Which configuration files should I provide to get hints ?
      Please help.

      Thanks
      Annegret

        • 1. Re: JBoss hangs using staeful session bean to read data
          Scott Stark Master

          The current ejb3 release is at RC5 so check out its improvements.

          • 2. Re: JBoss hangs using staeful session bean to read data
            Annegret Sternagel Newbie

            Hello,

            I've updated to JBoss 4.0.4RC1 with EJB3 RC5.
            Now the problem is different:

            when I return the data (and on bean passivation) I get a SerializationException

            2006-02-24 14:43:45,325 ERROR [com.tenovis.oam.i33.as.sb.SubscriberSBBean] Error:
            java.lang.reflect.InvocationTargetException
             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 com.tenovis.oam.i33.as.sb.OAMSBBean.invokeSbMethod(OAMSBBean.java:782)
             at com.tenovis.oam.i33.as.sb.SubscriberSBBean.readDataFromSb(SubscriberSBBean.java:779)
             at com.tenovis.oam.i33.as.sb.SubscriberSBBean.readObjectData(SubscriberSBBean.java:259)
             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.invocation.Invocation.performCall(Invocation.java:359)
             at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:598)
             at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
             at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
             at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:330)
             at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
             at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
             at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
             at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:206)
             at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
             at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:643)
             at org.jboss.ejb.Container.invoke(Container.java:917)
             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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
             at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
             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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
             at sun.rmi.transport.Transport$1.run(Transport.java:153)
             at java.security.AccessController.doPrivileged(Native Method)
             at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
             at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
             at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
             at java.lang.Thread.run(Thread.java:595)
            Caused by: java.lang.reflect.UndeclaredThrowableException
             at $Proxy505.readObjectData(Unknown Source)
             ... 45 more
            Caused by: org.jboss.serial.exception.SerializationException
             at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:83)
             at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
             at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
             at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:46)
             at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
             at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:111)
             at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
             at org.jboss.serial.io.MarshalledObject.<init>(MarshalledObject.java:51)
             at org.jboss.ejb3.SessionContainer.marshallResponse(SessionContainer.java:211)
             at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:223)
             at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:55)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
             at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
             ... 46 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(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:73)
             ... 60 more
            Caused by: java.lang.ClassCastException: [Ljava.lang.Class;
             at org.jboss.serial.persister.ClassReferencePersister.writeData(ClassReferencePersister.java:42)
             at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
             at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
             at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:46)
             at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
             at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
             at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:46)
             at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
             at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
             at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:46)
             at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
             at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
             at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:46)
             at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
             at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:45)
             at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
             at java.util.Hashtable.writeObject(Hashtable.java:813)
             ... 65 more
            

            see also thread
            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=76737&postdays=0&postorder=asc&start=0

            I got the patch mentioned in the thread above, but nothing changed.

            I've changed LAZY loading to EAGER and got the data without SerializaionException.
            But then during bean passivation I get a RuntimeException:

            javax.ejb.EJBException: Could not passivate; failed to save state
             at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:423)
             at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:107)
             at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:194)
             at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.run(LRUEnterpriseContextCachePolicy.java:434)
             at java.util.TimerThread.mainLoop(Timer.java:512)
             at java.util.TimerThread.run(Timer.java:462)
            Caused by: java.lang.RuntimeException: Could not resolve beanClass method from proxy call
             at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:260)
             at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:55)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
             at org.jboss.ejb3.stateful.StatefulRemoteProxy.invoke(StatefulRemoteProxy.java:133)
             at $Proxy501.getHandle(Unknown Source)
             at org.jboss.ejb.plugins.SessionObjectOutputStream.replaceObject(SessionObjectOutputStream.java:68)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1039)
             at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
             at java.util.Hashtable.writeObject(Hashtable.java:813)
             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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
             at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
             at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
             at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
             at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
             at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
             at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
             at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:414)
             ... 5 more
            


            Any idea ?

            Annegret