8 Replies Latest reply on Aug 6, 2008 6:48 AM by rapowder

    Infinite loop Exception while passivating a SFSB

    rapowder

      Hello,

      I am developing an application in the following environment

      * Framework: Seam 1.2.GA (problem not related to Seam)
      * JBoss: 4.0.5.GA + EJB3
      * VM: jdk 1.5.0_09-b03
      * DB: postgres
      * O/S: Linux Debian

      I encountered an exception (see stacktrace) which loops infinitely and forces me to kill the server.
      I suspect that the exception occurs at passivation of one of my SFSB. Somehow the serialization process enters in a recursive loop while writing a HashMap, but I am not sure weather the root cause is the IOException or the StackOverflow (see stacktrace).
      In the exception there is no trace of my application classes.

      I enabled DEBUG level logging for org.jboss.serial and org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager classes, reduced drastically the passivation timeout to 10secs and tried to execute the same actions that I had done when I first noticed the bug on my application, but I didn't yet manage to reproduce it.
      In the DEBUG log I noticed that the serialization of the most complex Beans takes very long time to serialize (~2secs). My Beans were actually not very well written in "Serialization-terms" (no serialVersionUID, no declaration of transient fields and no implementation of @PrePassivate and @PostActivate callback methods), since I don't really need passivation in my application. I will probably disable it, but I still would like to understand this bug.

      Also, I didn't find very much about similar problems on forums.

      Can anyone help?

      Here is the stacktrace. In the original "infinite" stacktrace, many parts were repeated, so I replaced them by comments.

      2008-06-12 15:34:32,864 FATAL [org.jboss.serial.persister.RegularObjectPersister] error
      java.lang.reflect.InvocationTargetException
      
       at sun.reflect.GeneratedMethodAccessor1236.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: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:298)
       at java.util.ArrayList.writeObject(ArrayList.java:569)
       at sun.reflect.GeneratedMethodAccessor1235.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: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:298)
       at java.util.HashMap.writeObject(HashMap.java:1038)
      
       ... same exception ~ 20 times
      
       at sun.reflect.GeneratedMethodAccessor1236.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: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)
      
      Caused by: java.lang.StackOverflowError
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
       at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
       at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:145)
       at org.apache.log4j.Category.forcedLog(Category.java:372)
       at org.apache.log4j.Category.fatal(Category.java:363)
       at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:127)
       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:298)
       at java.util.HashMap.writeObject(HashMap.java:1038)
      
       at sun.reflect.GeneratedMethodAccessor1236.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: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:298)
       at java.util.ArrayList.writeObject(ArrayList.java:569)
       at sun.reflect.GeneratedMethodAccessor1235.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: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:298)
       at java.util.HashMap.writeObject(HashMap.java:1038)
      
       ... same exception ~ 100 times
      
      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:298)
       at java.util.ArrayList.writeObject(ArrayList.java:569)
       at sun.reflect.GeneratedMethodAccessor1235.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: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:298)
       at java.util.HashMap.writeObject(HashMap.java:1038)
      
       ... Exception loops until app server is manually killed (Ctrl-C ignored)
      


        • 1. Re: Infinite loop Exception while passivating a SFSB
          rapowder

          I am sorry I can't be more precise about this bug, nobody has ANY clue?

          Just some more precisions about environment. I am using
          Jboss Serialization 1.0.3.GA (included in JBoss Messaging 1.2.0.sp1)

          From another log file on one of our servers I digged out the same exception and noticed that the all Beans were destroyed (logout from the webclient) about 20 min before exception occurred.
          This means that passivation doesn't look like being the cause, since it does not affect destroyed bean. Or am I wrong?
          I start getting confused about what could have happened to throw the exception. Does garbage collection imply some kind of serialization process?

          Some of my SFSB fields are HashMaps of ArrayLists. The objects in the Arraylists have a quite complex structure (including unserializable fields). What surprises me is not to have a serialization error because of these fields, but that the exception never ends and starts looping until server is killed.

          Regarding the exception I posted, the comments like *same exception ~* just mean that the part right before is repeated.

          • 2. Re: Infinite loop Exception while passivating a SFSB
            clebert.suconic

            Since I don't have any evidence of what happened I will have to guess:

            This looks like a recursive write. Are you trying to use HashMaps as trees?

            A recursive write is okay, but if you keep adding circular references you won't have stack to process the recursive calls necessary here.

            Something like:

            Map.put(key, AnotherMap);
            AnotherMap.put(key,SubMap);

            Maybe indirectly through fields?

            Or maybe your code has some loop doing that by accident?


            If you ask for my guess, I would say this is the most possible cause.

            If this is not true,

            What operation where you performing.

            Is this using any POJOs you wrote? Maybe there is something wrong with them?


            On any case this is a symptom of another bug, and I don't think this is a bug on the Serialization itself.

            • 3. Re: Infinite loop Exception while passivating a SFSB
              rapowder

              Thanks for your reply.

              This looks like a recursive write. Are you trying to use HashMaps as trees?


              Actually I do not have Maps of Maps if that's what you mean. The "candidate" for this Serialization problem seems the following map (which is the field of a SFSB):

              TreeMap<SimpleValue, List<Item>> map


              where SimpleValue is a simple object with two string fields and Item is a quite complex EntityBean among which fields there are also 5 collections.

              @Entity
              @Table(name="item")
              public class MItem implements Serializable


              The objects in these collections may have back references to the item itself. e.g. Item has a ManyToMany relation with the Property object, so each item has a list of properties

              @ManyToMany
              @JoinTable(name = "item_prop",
              joinColumns = {@JoinColumn(name = "ip_item")},
              inverseJoinColumns = {@JoinColumn(name = "ip_prop")})
              List<Property> properties
              


              and each Property has a reference to a list of parent items

              @ManyToMany(mappedBy = "properties")
              List<Item> items
              



              What operation where you performing?


              The bug, as far as I know from the logs, has been seen twice:

              - once, as explained above, the user logged out from the webclient since 20 minutes (so nomore stateful beans around to passivate) and the only process turning was a set of stateless beans that polls rpcs messages received from wireless devices. in this case my question is: when does serialization come into play?

              - second time the user was loading (readonly) the jsf page backed by the bean that I described to see values updates. The TreeMap contains a list of agenda items, and the keys of the map are just some string formatted dates (e.g. key::Day , values::agendasOfTheDay). The TreeMap is used to load the agendas of the day when the user selects the day from a selectMenu and refreshes the page.

              Hope you can give me some further support..

              Thank you, cheers
              Andrea

              • 4. Re: Infinite loop Exception while passivating a SFSB
                clebert.suconic

                This might be happening because of the excessive stack on the TreeMap.

                Maybe you could increase your Stack configuration?


                I would need a testcase replicating this problem for being able to help more.

                • 5. Re: Infinite loop Exception while passivating a SFSB
                  rapowder

                   

                  This might be happening because of the excessive stack on the TreeMap.


                  Well, it could be, but not sure that this TreeMap could get too big. I have to check if somewhere else in the code I have similar maps.
                  Still, about my first question: if all SFSB are destroyed, when can serialization happen? Passivation applies only on inactive beans right? And how about garbage collection? Does it involve any calls to the jboss.serial library?

                  I would need a testcase replicating this problem for being able to help more.


                  Yes I know, but I can't replicate it myself yet, so I'd need it too..

                  I'll be away for 2 weeks now. I'll keep on digging this bug when I'm back.. Thanks again for support! Please keep watching this topic in 2 weeks ;)

                  • 6. Re: Infinite loop Exception while passivating a SFSB
                    clebert.suconic

                     

                    Well, it could be, but not sure that this TreeMap could get too big. I have to check if somewhere else in the code I have similar maps.
                    Still, about my first question: if all SFSB are destroyed, when can serialization happen? Passivation applies only on inactive beans right? And how about garbage collection? Does it involve any calls to the jboss.serial library?


                    That I don't know...

                    I hope Carlo would see this message..


                    Carlo?

                    • 7. Re: Infinite loop Exception while passivating a SFSB
                      rapowder

                      Hi again,

                      so I'm back from vacation, digging on the problem again.


                      A recursive write is okay, but if you keep adding circular references you won't have stack to process the recursive calls necessary here.

                      Something like:

                      Map.put(key, AnotherMap);
                      AnotherMap.put(key,SubMap);
                      Maybe indirectly through fields?


                      I tried to encapsulate many HashMaps and serializing them actually gave me the same exception. So root cause is a StackOverflow as you suggested.

                      Since in my code I don't have such deep encapsulations, I guess it's an indirect encapsulation through the objects contained in my HashMaps.
                      I tried to fill as maximum as possible the HashMap in the Bean that may be the cause of the exception, but serialization still worked fine.

                      So, here is my question:

                      When serialization occurs, a stack is created for each serialized field or for the whole bean, or even for all serialized beans?
                      Practically what I'm trying to understand is if the number of serialized beans may have an influence or not?
                      If I can't reproduce the exception "filling" all the fields of the "guilty" bean, could it help to navigate through my whole webclient in order to maximize the number of serialized beans?





                      • 8. Re: Infinite loop Exception while passivating a SFSB
                        rapowder

                        Nevermind, that was really a stupid question...
                        Anyway I found out where the stackoverflow occurs!

                        Loading the hashmap as maximum as possible as I was trying to do was right, but I wasn't initializing internal collections of my complex objects before serialization.

                        Once all collections of my objects of type MItem are initialized, serializing a HashMap that contains them becomes an impossible operation.
                        Disabling passivation was in my plans anyway.

                        Thanx for the hints Cubert.