13 Replies Latest reply on Mar 19, 2007 12:56 PM by nico.ben

    Debug support for Serialization

      Hello,
      I'm not sure if this is the right forum for the problem but for some parts is sure is. I'm looking for a way to debug this weird serialization error i'm having (Running JBoss 4.0.4 GA). I've no idea who is working with offending class org.jaxen.VariableContext or why it's included anyhow.. What're the tools or options to start tracking problem like this? Is there a way to show the instance object tree from which the class is referenced.. Maybe turn up some logging or?

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


      javax.ejb.EJBException: Could not passivate; failed to save state
       at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:363)
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:194)
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:129)
      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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:181)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
       at org.jboss.serial.io.MarshalledObject.<init>(MarshalledObject.java:51)
       at org.jboss.ejb3.stateful.StatefulBeanContext.writeExternal(StatefulBeanContext.java:401)
       at org.jboss.serial.persister.ExternalizePersister.writeData(ExternalizePersister.java:58)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:181)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
       at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:347)
       ... 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:585)
       at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
       ... 30 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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:60)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
       at java.util.HashMap.writeObject(HashMap.java:985)
       ... 35 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.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
       ... 106 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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:60)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
       at EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArrayList.writeObject(CopyOnWriteArrayList.java:772)
       ... 111 more
      Caused by: java.lang.reflect.InvocationTargetException
       at sun.reflect.GeneratedMethodAccessor922.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
       ... 128 more
      Caused by: java.lang.NoClassDefFoundError: org/jaxen/VariableContext
       at java.lang.Class.getDeclaredMethods0(Native Method)
       at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
       at java.lang.Class.getDeclaredMethod(Class.java:1907)
       at org.jboss.serial.classmetamodel.ClassMetaData.lookupMethodOnHierarchy(ClassMetaData.java:101)
       at org.jboss.serial.classmetamodel.ClassMetaData.lookupInternalMethods(ClassMetaData.java:417)
       at org.jboss.serial.classmetamodel.ClassMetaData.<init>(ClassMetaData.java:121)
       at org.jboss.serial.classmetamodel.ClassMetamodelFactory.getClassMetaData(ClassMetamodelFactory.java:335)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:167)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:275)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
       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:1018)
       ... 132 more
      


        • 1. Re: Debug support for Serialization
          clebert.suconic

          You can activate debug for org.jboss.serial into log4j.xml.

          But for a classNotFoundException during metadata discovery (that''s what happened) it''s better if you look at your source tree if you are using such object first.

          If you are you/we might want to take a look at classLoader isolations.

          • 2. Re: Debug support for Serialization

            Interesting, i'll try to dig in deeper..

            2006-05-26 15:51:10,218 DEBUG [org.jboss.serial.objectmetamodel.ObjectDescriptorFactory] describeObject for class=java.lang.Class
            2006-05-26 15:51:10,218 DEBUG [org.jboss.serial.util.HashStringUtil] hash on field org.dom4j.DocumentFactory = -1337478231170808713
            2006-05-26 15:51:10,218 DEBUG [org.jboss.serial.classmetamodel.ClassMetaData] lookupMethodOnHierarchy::class=org.dom4j.DocumentFactory looking for readResolve
            2006-05-26 15:51:10,218 DEBUG [org.jboss.serial.classmetamodel.ClassMetaData] lookupMethodOnHierarchy::currentClass=class org.dom4j.DocumentFactory
            2006-05-26 15:51:10,218 FATAL [org.jboss.serial.persister.RegularObjectPersister] error
            java.lang.reflect.InvocationTargetException
             at sun.reflect.GeneratedMethodAccessor346.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             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:275)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
             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:275)
             at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:202)
             at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
            
            
            


            • 3. Re: Debug support for Serialization
              clebert.suconic

              Take a look if you have trove.jar in your /lib (or if jboss-deployer.aop) is available. I had some similar problems yesterday.

              • 4. Re: Debug support for Serialization
                clebert.suconic

                 

                "clebert.suconic@jboss.com" wrote:
                Take a look if you have trove.jar in your /lib (or if jboss-deployer.aop) is available. I had some similar problems yesterday.


                Scratch that, I looked deeper at your stack trace. It can't be that.

                What version of JBoss are you using?

                • 5. Re: Debug support for Serialization

                  4.0.4 GA

                  • 6. Re: Debug support for Serialization

                    Hello,
                    I tried to locate the sources for the Serialization that's included with 404GA. Didn't find it with from the jboss-4.0.4.GA-src bundle (Eclipde didn't), should it be there or where to get it?

                    • 7. Re: Debug support for Serialization
                      clebert.suconic

                      CVS@jboss-serialization.

                      Look for TAG 1.0.0.GA.

                      Can you produce a testcase for this?

                      how you are getting this error?

                      • 8. Re: Debug support for Serialization
                        clebert.suconic

                        Just a guess.
                        JBossSerialization will try to serialize anything non serializable.

                        Like, even a socket could be serialized, and I've tried deserializing it, and it worked.

                        But there might be some data structure that won't work with serialization. For instance it looks like you have a XML parser referenced in your Stateful Object.

                        On that case, you might want to try specifying the word transient at these fields, this way JBossSerialization will ignore that field.


                        But I'm still interested on what usecase is failing for you. So, if you could produce a testcase, I would appreciate it.


                        thanks,

                        Clebert Suconic

                        • 9. Re: Debug support for Serialization
                          hmesha

                          Have you been able to find out the root cause of this issue? I'm seeing the same exception thrown using JBossAS 4.0.5CR1. I'd like to find out if there's a solution or known bug to this before I start digging in the code.

                          Thanks,

                          Hany

                          • 10. Re: Debug support for Serialization
                            clebert.suconic

                            You probably has a non serializable class, without a default constructor in your object's graph.

                            • 11. Re: Debug support for Serialization
                              dustismo

                              Has anyone found a solution to this problem? I am getting the same exceptions and haven't found a solution. Every class in my app is serializable and has a default constructor.

                              using jboss 4.0.5.GA and seam 1.1.1

                              thanks
                              Dustin

                              • 12. Re: Debug support for Serialization
                                clebert.suconic

                                 

                                Every class in my app is serializable and has a default constructor.


                                This problem is about non serializable classes without a default constructor.

                                • 13. Re: Debug support for Serialization
                                  nico.ben

                                   

                                  "clebert.suconic@jboss.com" wrote:
                                  Every class in my app is serializable and has a default constructor.


                                  This problem is about non serializable classes without a default constructor.


                                  Hi!
                                  Is there a way to find which class causes this?
                                  The log output doesn't seem to contain the name of my guilty class :)

                                  Thx,
                                  Nic