-
Bug
-
Resolution: Done
-
Critical
-
1.5.1.Final
-
None
-
None
To print out the jar information in exception stack traces, the log manager needs to resolve the class name from StackTraceElement to the Class object. Since the log manager cannot know which classloader was used, guessClass() tries the TCCL, the logmanager's classloader and finally the system classloader.
It is possible that the TCCL contains a class of the same name as the one in the stack frame, but it not the same class. This can easily happen if the application packages a jar that is also used by the container. In this situation, the class may not be able to be loaded, such as if the application-packages class is missing it's dependencies.
If Class.forName() would throw a NoClassDefFoundError or similar, JBoss Modules (or other classloader implementation) may attempt to log this using java.util.logging API. This can result in infinite recursion, for example
... at org.jboss.logmanager.Logger.log(Logger.java:367) at org.jboss.modules.log.JDKModuleLogger.doLog(JDKModuleLogger.java:109) at org.jboss.modules.log.JDKModuleLogger.classDefineFailed(JDKModuleLogger.java:194) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:401) at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) at org.jboss.modules.Module.loadModuleClass(Module.java:527) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:266) at org.jboss.logmanager.formatters.Formatters$12.guessClass(Formatters.java:578) at org.jboss.logmanager.formatters.Formatters$12.renderExtended(Formatters.java:421) at org.jboss.logmanager.formatters.Formatters$12.renderRaw(Formatters.java:388) at org.jboss.logmanager.formatters.Formatters$JustifyingFormatStep.render(Formatters.java:150) at org.jboss.logmanager.formatters.MultistepFormatter.format(MultistepFormatter.java:86) at org.jboss.logmanager.ExtFormatter.format(ExtFormatter.java:35) at org.jboss.logmanager.handlers.WriterHandler.doPublish(WriterHandler.java:49) at org.jboss.logmanager.ExtHandler.publish(ExtHandler.java:76) at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:290) at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:298) at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:298) at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:298) at org.jboss.logmanager.Logger.logRaw(Logger.java:721) at org.jboss.logmanager.Logger.logRaw(Logger.java:731) at org.jboss.logmanager.Logger.log(Logger.java:367) ...
- is duplicated by
-
LOGMGR-88 Endless loop on class defined failed
- Closed