You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "jaumegras (via GitHub)" <gi...@apache.org> on 2024/10/29 11:03:37 UTC
[I] ThrowableProxyHelper fails if a class in logged stack trace throws java.lang.Error from initializer (logging-log4j2)
jaumegras opened a new issue, #3137:
URL: https://github.com/apache/logging-log4j2/issues/3137
## Description
When the Logger attempts to log a message with an exception stack trace, it uses the ThrowableProxyHelper 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 ThrowableProxyHelper 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.
Have there been any changes? The same bug LOG4J2-832 was reported and fixed for version 2.1.
## Configuration
**Version:** 2.23.1
**Operating system:** Oracle Linux Server 9.4
**JDK:** 11.0.23 2024-04-16 LTS
## Logs
org.apache.logging.log4j.core.appender.AppenderLoggingException: java.lang.Error: Trampoline must not be defined by the bootstrap classloader
at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:164)
at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:133)
at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:124)
at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:88)
at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:705)
at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:663)
at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:639)
at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:575)
at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:92)
at org.apache.logging.log4j.core.Logger.log(Logger.java:169)
at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2906)
at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2859)
at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2841)
at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2620)
at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:2567)
at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:808)
at com.xxx.xxx.xxx.xxx.clients.migration.MainKt.main(Main.kt:42)
Caused by: java.lang.Error: Trampoline must not be defined by the bootstrap classloader
at java.base/sun.reflect.misc.Trampoline.<clinit>(MethodUtil.java:51)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at org.apache.logging.log4j.util.LoaderUtil.loadClass(LoaderUtil.java:207)
at org.apache.logging.log4j.core.impl.ThrowableProxyHelper.loadClass(ThrowableProxyHelper.java:213)
at org.apache.logging.log4j.core.impl.ThrowableProxyHelper.toExtendedStackTrace(ThrowableProxyHelper.java:112)
at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:144)
at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:149)
at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:118)
at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:96)
at org.apache.logging.log4j.core.impl.Log4jLogEvent.getThrownProxy(Log4jLogEvent.java:818)
at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:63)
at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:44)
at org.apache.logging.log4j.core.layout.PatternLayout$PatternFormatterPatternSerializer.toSerializable(PatternLayout.java:397)
at org.apache.logging.log4j.core.layout.PatternLayout.toText(PatternLayout.java:252)
at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:238)
at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:58)
at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:227)
at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:220)
at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:211)
at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:160)
... 16 more
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ThrowableProxyHelper fails if a class in logged stack trace throws java.lang.Error from initializer (logging-log4j2)
Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on issue #3137:
URL: https://github.com/apache/logging-log4j2/issues/3137#issuecomment-2449739157
Fixed by #3047.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ThrowableProxyHelper fails if a class in logged stack trace throws java.lang.Error from initializer (logging-log4j2)
Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on issue #3137:
URL: https://github.com/apache/logging-log4j2/issues/3137#issuecomment-2445119648
@jaumegras, in the upcoming `2.25.0` release, `ThrowableProxy` et al. will be deprecated and not used anymore. Would you mind checking against `2.25.0-SNAPSHOT` (see [Using snapshots](https://logging.apache.org/log4j/2.x/manual/installation.html#snapshots) page) and reporting us the outcome, please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ThrowableProxyHelper fails if a class in logged stack trace throws java.lang.Error from initializer (logging-log4j2)
Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on issue #3137:
URL: https://github.com/apache/logging-log4j2/issues/3137#issuecomment-2449736444
@jaumegras, thanks for the confirmation. We don't have a concrete date for the `2.25.0` release, I guess it should happen in a month or two.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ThrowableProxyHelper fails if a class in logged stack trace throws java.lang.Error from initializer (logging-log4j2)
Posted by "vy (via GitHub)" <gi...@apache.org>.
vy closed issue #3137: ThrowableProxyHelper fails if a class in logged stack trace throws java.lang.Error from initializer
URL: https://github.com/apache/logging-log4j2/issues/3137
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ThrowableProxyHelper fails if a class in logged stack trace throws java.lang.Error from initializer (logging-log4j2)
Posted by "jaumegras (via GitHub)" <gi...@apache.org>.
jaumegras commented on issue #3137:
URL: https://github.com/apache/logging-log4j2/issues/3137#issuecomment-2449360255
@vy , checking it against a 4.2.5-SNAPSHOT does not happen the problem. Could you tell me if there is a release date for this release? Thank you very much
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org