[
https://issues.apache.org/jira/browse/LOG4J2-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14135911#comment-14135911
]
Seth Leger commented on LOG4J2-832:
-----------------------------------
Here's the stack trace from the failure of the unit test:
{noformat}
java.lang.Error: Trampoline must not be defined by the bootstrap classloader
at sun.reflect.misc.Trampoline.<clinit>(MethodUtil.java:55)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at
org.apache.logging.log4j.core.util.Loader.initializeClass(Loader.java:285)
at
org.apache.logging.log4j.core.impl.ThrowableProxy.loadClass(ThrowableProxy.java:500)
at
org.apache.logging.log4j.core.impl.ThrowableProxy.toExtendedStackTrace(ThrowableProxy.java:621)
at
org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:146)
at
org.apache.logging.log4j.core.impl.Log4jLogEvent.getThrownProxy(Log4jLogEvent.java:323)
at
org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:64)
at
org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:36)
at
org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:189)
at
org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:53)
at
org.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:52)
at
org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:104)
at
org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:97)
at
org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:428)
at
org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:407)
at
org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:365)
at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:112)
at
org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1336)
at
org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1325)
at
org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:551)
at
Log4j2MethodUtilTrampolineTest.testTrampolineException(Log4j2MethodUtilTrampolineTest.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
{noformat}
> ThrowableProxy fails if sun.reflect.misc.Trampoline is in logged stack trace
> ----------------------------------------------------------------------------
>
> Key: LOG4J2-832
> URL: https://issues.apache.org/jira/browse/LOG4J2-832
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0, 2.0.2
> Environment: Java 1.7u60, Java 1.7u25
> Reporter: Seth Leger
> Priority: Blocker
> Attachments: Log4j2MethodUtilTrampolineTest.java, pom.xml
>
>
> When the Logger attempts to log a message with an exception stack trace, it
> uses the ThrowableProxy class to introspect classes in the stack trace frames.
> If the class sun.reflect.misc.Trampoline is in the stack trace, the
> introspection performed by ThrowableProxy will fail causing a java.lang.Error
> to be thrown by the Logger call.
> The sun.reflect.misc.Trampoline class is used by the
> sun.reflect.misc.MethodUtil class to perform reflection-based method
> invocations. MethodUtil is widely used by libraries to perform method
> invocations. I've encountered this problem when invoking methods over JMX and
> inside Jetty.
> I am classifying this as a blocker because it means that any logging
> statement that is logging a Throwable message containing a MethodUtil-based
> reflection stack trace can cause a java.lang.Error to be thrown by Log4j2.
> I will attach a unit test for this failure.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]