1 Reply Latest reply on Aug 3, 2011 7:22 AM by David Bosschaert

    Using pax-logging-service bundle hang JBoss

    Arnaud MERGEY Newbie

      Hello,

       

      I have an osgi web application using equinox servlet briges in order to be packaged as a legacy WAR file and deployable in non osgi application server, like jetty, tomcat, and jboss (older version than 7)

      I am using pax-logging service bundle inside my application. After deploying my application, the whole JBoss container stop reponding, because StackOverflow occurs each time someone logs someting inside the container.

       

      Internally, pax-logging use log4j and I noticed stackoverflow occured when something was logged using default root logger (on stdout).

      After configuring pax-logging ( -Dorg.ops4j.pax.logging.DefaultServiceLog.level=ERROR) to prevent something to be logged using this logger, it remove the Stackoverflow issue, but JBoss does not output anything anymore. So it seems that all JBoss logs go through pax-logging, even for other applications than mine.

       

      I am quite surprised, because I thought JBoss 6 did not use log4j anymore, so I do not understand, why pax-logging is conflicting with JBoss

       

      Is there any way to isolate pax from my application to conflict with some JBoss logging layer ?

       

      Also just for information, in order to check I tried to deploy pax-logging service bundle directly in JBossAS 7, and there is exactly the same issue, JBoss hang because of same stackoverflow.

       

      And the stack trace of StackOverflow is:

       

      11:52:19,996 INFO  [stdout] -logging-service - BundleEvent STARTED

       

      11:52:19,996 INFO  [stdout] j.pax.logging.pax-logging-service - BundleEvent STARTED

       

      11:52:20,005 INFO  [stdout] j.pax.logging.pax-logging-service - BundleEvent STARTED

       

      11:52:20,005 INFO  [stdout] java.lang.StackOverflowError

       

      11:52:20,005 INFO  [stdout]     at org.apache.log4j.CategoryKey.<init>(CategoryKey.java:30)

       

      11:52:20,006 INFO  [stdout]     at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:266)

       

      11:52:20,006 INFO  [stdout]     at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:247)

       

      11:52:20,006 INFO  [stdout]     at org.apache.log4j.LogManager.getLogger(LogManager.java:228)

       

      11:52:20,007 INFO  [stdout]     at org.apache.log4j.Logger.getLogger(Logger.java:104)

       

      11:52:20,007 INFO  [stdout]     at org.ops4j.pax.logging.service.internal.PaxLoggingServiceImpl.getLogger(PaxLoggingServiceImpl.java:75)

       

      11:52:20,007 INFO  [stdout]     at org.ops4j.pax.logging.service.internal.JdkHandler.publish(JdkHandler.java:78)

       

      11:52:20,007 INFO  [stdout]     at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:283)

       

      11:52:20,007 INFO  [stdout]     at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:291)

       

      11:52:20,008 INFO  [stdout]     at org.jboss.logmanager.Logger.logRaw(Logger.java:649)

       

      11:52:20,008 INFO  [stdout]     at org.jboss.logmanager.Logger.log(Logger.java:434)

       

      11:52:20,008 INFO  [stdout]     at org.jboss.stdio.AbstractLoggingWriter.write(AbstractLoggingWriter.java:71)

       

      11:52:20,009 INFO  [stdout]     at org.jboss.stdio.WriterOutputStream.finish(WriterOutputStream.java:137)

       

      11:52:20,009 INFO  [stdout]     at org.jboss.stdio.WriterOutputStream.write(WriterOutputStream.java:106)

       

      11:52:20,009 INFO  [stdout]     at java.io.PrintStream.write(PrintStream.java:430)

       

      11:52:20,009 INFO  [stdout]     at org.jboss.stdio.StdioContext$DelegatingPrintStream.write(StdioContext.java:225)

       

      11:52:20,010 INFO  [stdout]     at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)

       

      11:52:20,010 INFO  [stdout]     at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)

       

      11:52:20,011 INFO  [stdout]     at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)

       

      11:52:20,011 INFO  [stdout]     at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116)

       

      11:52:20,011 INFO  [stdout]     at java.io.OutputStreamWriter.write(OutputStreamWriter.java:203)

       

      11:52:20,011 INFO  [stdout]     at java.io.Writer.write(Writer.java:140)

       

      11:52:20,012 INFO  [stdout]     at org.apache.log4j.helpers.QuietWriter.write(QuietWriter.java:48)

       

      11:52:20,012 INFO  [stdout]     at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:310)

       

      11:52:20,012 INFO  [stdout]     at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)

       

      11:52:20,012 INFO  [stdout]     at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)

       

      11:52:20,013 INFO  [stdout]     at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)

       

      11:52:20,013 INFO  [stdout]     at org.apache.log4j.Category.callAppenders(Category.java:206)

       

      11:52:20,013 INFO  [stdout]     at org.apache.log4j.Category.forcedLog(Category.java:391)

       

      11:52:20,013 INFO  [stdout]     at org.apache.log4j.Category.log(Category.java:856)

       

      11:52:20,014 INFO  [stdout]     at org.ops4j.pax.logging.service.internal.PaxLoggerImpl.log(PaxLoggerImpl.java:231)

       

      11:52:20,014 INFO  [stdout]     at org.ops4j.pax.logging.service.internal.JdkHandler.publish(JdkHandler.java:106)

       

      11:52:20,014 INFO  [stdout]     at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:283)

       

      11:52:20,014 INFO  [stdout]     at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:291)

       

      11:52:20,015 INFO  [stdout]     at org.jboss.logmanager.Logger.logRaw(Logger.java:649)

       

      11:52:20,015 INFO  [stdout]     at org.jboss.logmanager.Logger.log(Logger.java:434)

       

      11:52:20,015 INFO  [stdout]     at org.jboss.stdio.AbstractLoggingWriter.write(AbstractLoggingWriter.java:71)

       

      11:52:20,015 INFO  [stdout]     at org.jboss.stdio.WriterOutputStream.finish(WriterOutputStream.java:137)

       

      11:52:20,016 INFO  [stdout]     at org.jboss.stdio.WriterOutputStream.write(WriterOutputStream.java:106)

       

      11:52:20,016 INFO  [stdout]     at java.io.PrintStream.write(PrintStream.java:430)

       

       

      ...

      ...

      ...

       

       

      11:52:21,419 INFO  [stdout]     at org.apache.log4j.helpers.QuietWriter.write(QuietWriter.java:48)

       

      11:52:21,419 INFO  [stdout]     at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:310)

       

      11:52:21,419 INFO  [stdout]     at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)

       

      11:52:21,419 INFO  [stdout]     at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)

       

      11:52:21,419 INFO  [stdout]     at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)

       

      11:52:21,419 INFO  [stdout]     at org.apache.log4j.Category.callAppenders(Category.java:206)

       

      11:52:21,419 INFO  [stdout]     at org.apache.log4j.Category.forcedLog(Category.java:391)

       

      11:52:21,419 INFO  [stdout]     at org.apache.log4j.Category.log(Category.java:856)

       

      11:52:21,419 INFO  [stdout]     at org.ops4j.pax.logging.service.internal.PaxLoggerImpl.log(PaxLoggerImpl.java:231)

       

      11:52:21,420 INFO  [stdout]     at org.ops4j.pax.logging.service.internal.JdkHandler.publish(JdkHandler.java:106)

       

      11:52:21,420 INFO  [stdout]     at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:283)

       

      11:52:21,420 INFO  [stdout]     at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:291)

       

      11:52:21,420 INFO  [stdout]     at org.jboss.logmanager.Logger.logRaw(Logger.java:649)

       

      11:52:21,420 INFO  [stdout]     at org.jboss.logmanager.Logger.log(Logger.java:434)

       

      11:52:21,420 INFO  [stdout]     at org.jboss.stdio.AbstractLoggingWriter.write(AbstractLoggingWriter.java:71)

       

      11:52:21,420 INFO  [stdout]     at org.jboss.stdio.WriterOutputStream.finish(WriterOutputStream.java:137)

       

      11:52:21,420 INFO  [stdout]     at org.jboss.stdio.WriterOutputStream.write(WriterOutputStream.java:106)

       

      11:52:21,420 INFO  [stdout]     at java.io.PrintStream.write(PrintStream.java:430)

       

      11:52:21,420 INFO  [stdout]     at org.jboss.stdio.StdioContext$DelegatingPrintStream.write(StdioContext.java:225)

       

      11:52:21,420 INFO  [stdout]     at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)

       

      11:52:21,420 INFO  [stdout]     at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)

       

      11:52:21,421 INFO  [stdout]     at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)