JBoss deadlocks due to log4j serialization

Solution Verified - Updated -

Issue

  • JBoss becomes unresponsive with threads getting stalled in log4j. Thread dumps show log4j is deadlocked like so:
"ajp-127.0.0.1-8009-1":
    at org.apache.log4j.Category.callAppenders(Category.java:201)
    - waiting to lock <0x00000006eb935130> (a org.apache.log4j.spi.RootLogger)
    at org.apache.log4j.Category.forcedLog(Category.java:388)
    at org.apache.log4j.Category.fatal(Category.java:379)
    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$DataContainerOutput.writeObject(DataContainer.java:390)
    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$DataContainerOutput.writeObject(DataContainer.java:390)
    at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
        ...
        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$DataContainerOutput.writeObject(DataContainer.java:390)
    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$DataContainerOutput.writeObject(DataContainer.java:390)
    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)
    - locked <0x00000006ec86e8b0> (a java.util.Vector)
    at sun.reflect.GeneratedMethodAccessor1794.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)
        ...

"ajp-127.0.0.1-8009-2" prio=10 tid=0x00002aaad54f7800 nid=0x3e84 waiting for monitor entry [0x000000005adfb000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at java.util.Vector.size(Vector.java:268)
    - waiting to lock <0x00000006ec86e8b0> (a java.util.Vector)
    at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:62)
    at org.apache.log4j.Category.callAppenders(Category.java:203)
    - locked <0x00000006eb935130> (a org.apache.log4j.spi.RootLogger)
    at org.apache.log4j.Category.forcedLog(Category.java:388)
    at org.apache.log4j.Category.log(Category.java:853)
        ...

Environment

  • JBoss Enterprise Application Platform (EAP)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In