4 Replies Latest reply on May 5, 2009 6:34 AM by dpl007

    Exception during passivation a stateful session bean

    dpl007 Newbie

      Hello,
      I use EJB 3.0 and JBoss AS 4.2.3.
      I am using a SFSB that uses JPA to persist its data. The dependency injected EntityManager has a PersistenceContextType extended.

      Here is excerpt from my bean.

      @Stateful
      @ApplicationException(rollback = false)
      @TransactionManagement(TransactionManagementType.BEAN)
      
      public class ModelFacade implements IModelFacadeRemote {
      
       private static final long serialVersionUID = 1L;
      
       @Resource
       private UserTransaction utx;
      
       @PersistenceContext(unitName = "foo", type = PersistenceContextType.EXTENDED)
       protected EntityManager em;
      
       @SuppressWarnings("unchecked")
       public Collection<Object> findAllFreshItems(Class type) {
      
       String sql = "SELECT i FROM " + type.getSimpleName() + " i";
       List<Object> resultList = em.createQuery(sql).setHint(
       QueryHints.REFRESH, HintValues.TRUE).getResultList();
       return resultList;
       }
      
       @SuppressWarnings("unchecked")
       public Collection<Object> findAllItems(Class type) {
      
       String sql = "SELECT i FROM " + type.getSimpleName() + " i";
       List<Object> resultList = em.createQuery(sql).getResultList();
       return resultList;
       }
      
       // findSingleItem
       @SuppressWarnings("unchecked")
       public Object findSingleItem(Object id, Class type) {
       return em.find(type, id);
       }
      


      The bean and the application works fine, but if JBoss AS tries to passivate I get the errors:

      2009-04-23 13:08:40,135 FATAL [org.jboss.serial.persister.RegularObjectPersister] error
      java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:60)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
      at EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArrayList.writeObject(CopyOnWriteArrayList.java:772)
      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:597)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:60)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
      at java.util.HashMap.writeObject(HashMap.java:1001)
      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:597)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
      at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
      at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.ArrayPersister.saveObjectArray(ArrayPersister.java:110)
      at org.jboss.serial.persister.ArrayPersister.writeData(ArrayPersister.java:101)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:181)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
      at org.jboss.serial.io.MarshalledObject.(MarshalledObject.java:51)
      at org.jboss.ejb3.stateful.StatefulBeanContext.writeExternal(StatefulBeanContext.java:857)
      at org.jboss.serial.persister.ExternalizePersister.writeData(ExternalizePersister.java:58)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:181)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
      at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:390)
      at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:301)
      at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:209)
      Caused by: java.lang.NoClassDefFoundError: org/jaxen/VariableContext
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
      at java.lang.Class.getDeclaredMethod(Class.java:1935)
      at org.jboss.serial.classmetamodel.ClassMetaData.lookupMethodOnHierarchy(ClassMetaData.java:102)
      at org.jboss.serial.classmetamodel.ClassMetaData.lookupInternalMethods(ClassMetaData.java:432)
      at org.jboss.serial.classmetamodel.ClassMetaData.(ClassMetaData.java:122)
      at org.jboss.serial.classmetamodel.ClassMetamodelFactory.getClassMetaData(ClassMetamodelFactory.java:350)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:168)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.ArrayPersister.saveObjectArray(ArrayPersister.java:110)
      at org.jboss.serial.persister.ArrayPersister.writeData(ArrayPersister.java:101)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
      at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
      at org.jboss.serial.persister.ObjectOutputStreamProxy.writeFields(ObjectOutputStreamProxy.java:79)
      at org.jboss.serial.persister.ObjectOutputStreamProxy.defaultWriteObject(ObjectOutputStreamProxy.java:68)
      at java.util.Vector.writeObject(Vector.java:1012)
      ... 93 more
      Caused by: java.lang.ClassNotFoundException: org.jaxen.VariableContext
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      ... 110 more

      It seems as if JBoss AS is not be able to passivate the bean.

      For all the tips I would be very grateful!

      Best regards,

      Dmitri

        • 1. Re: Exception during passivation a stateful session bean
          jaikiran pai Master

           

          Caused by: java.lang.NoClassDefFoundError: org/jaxen/VariableContext


          Though this message talks about a NoClassDefFoundError, the actual reason is that you have a non-serializable object in the StatefulSession bean hierarchy. There was an issue talking about this incorrect error message.


          • 2. Re: Exception during passivation a stateful session bean
            jaikiran pai Master

             

            "jaikiran" wrote:
            There was an issue talking about this incorrect error message.


            https://jira.jboss.org/jira/browse/JBSER-107

            • 3. Re: Exception during passivation a stateful session bean
              dpl007 Newbie

              Hello jaikiran,

              thank you for reply.
              Is there a way to find which class is not serializable? Because when I use PersistenceContextType.TRANSACTION then I get no errors and passivate/activate run OK.

              Thank you again!

              Dmitri

              • 4. Re: Exception during passivation a stateful session bean
                dpl007 Newbie

                Hello,

                I implemented in all my classes a default empty constructor like described in https://jira.jboss.org/jira/browse/JBSER-107. But I get still errors:

                2009-05-05 10:03:16,610 ERROR [org.jboss.ejb3.cache.simple.SimpleStatefulCache.ModelFacade] problem passivation thread
                javax.ejb.EJBException: Could not passivate; failed to save state
                 at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:406)
                 at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:301)
                 at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:209)
                Caused by: java.io.IOException
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:129)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.ArrayPersister.saveObjectArray(ArrayPersister.java:110)
                 at org.jboss.serial.persister.ArrayPersister.writeData(ArrayPersister.java:101)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:181)
                 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
                 at org.jboss.serial.io.MarshalledObject.<init>(MarshalledObject.java:51)
                 at org.jboss.ejb3.stateful.StatefulBeanContext.writeExternal(StatefulBeanContext.java:857)
                 at org.jboss.serial.persister.ExternalizePersister.writeData(ExternalizePersister.java:58)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:181)
                 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
                 at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:390)
                 ... 2 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:597)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
                 ... 20 more
                Caused by: java.io.IOException
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:129)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:60)
                 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
                 at java.util.HashMap.writeObject(HashMap.java:1001)
                 ... 25 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:597)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
                 ... 67 more
                Caused by: java.io.IOException
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:129)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:60)
                 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
                 at EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArrayList.writeObject(CopyOnWriteArrayList.java:772)
                 ... 72 more
                Caused by: java.lang.reflect.InvocationTargetException
                 at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
                 ... 89 more
                Caused by: java.lang.NoClassDefFoundError: org/jaxen/VariableContext
                 at java.lang.Class.getDeclaredMethods0(Native Method)
                 at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
                 at java.lang.Class.getDeclaredMethod(Class.java:1935)
                 at org.jboss.serial.classmetamodel.ClassMetaData.lookupMethodOnHierarchy(ClassMetaData.java:102)
                 at org.jboss.serial.classmetamodel.ClassMetaData.lookupInternalMethods(ClassMetaData.java:432)
                 at org.jboss.serial.classmetamodel.ClassMetaData.<init>(ClassMetaData.java:122)
                 at org.jboss.serial.classmetamodel.ClassMetamodelFactory.getClassMetaData(ClassMetamodelFactory.java:350)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:168)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.ArrayPersister.saveObjectArray(ArrayPersister.java:110)
                 at org.jboss.serial.persister.ArrayPersister.writeData(ArrayPersister.java:101)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
                 at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.writeFields(ObjectOutputStreamProxy.java:79)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.defaultWriteObject(ObjectOutputStreamProxy.java:68)
                 at java.util.Vector.writeObject(Vector.java:1012)
                 ... 93 more
                Caused by: java.lang.ClassNotFoundException: org.jaxen.VariableContext
                 at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
                 at java.security.AccessController.doPrivileged(Native Method)
                 at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                 at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                 ... 110 more
                


                And I get no errors when:
                - I use Hibernate instead of EclipseLink or
                - I use PersistenceContextType.TRANSACTION instead of PersistenceContextType.EXTENDED

                I guess this is the same problem like in Glassfish:
                https://glassfish.dev.java.net/issues/show_bug.cgi?id=824
                https://glassfish.dev.java.net/issues/show_bug.cgi?id=2624
                https://glassfish.dev.java.net/issues/show_bug.cgi?id=5283

                Is this a bug in JBoss also? Is there a workaroud for this problem?

                Thanks a lot in advance for your help.

                Best regards

                Dmitri