logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Goers (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1256) strange classloader failure
Date Sun, 17 Jan 2016 05:19:39 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15103595#comment-15103595
] 

Ralph Goers commented on LOG4J2-1256:
-------------------------------------

I don't see how not being Serializable would matter at all.

I also don't understand how it could be the wrong ClassLoader since the constructor for the
ThrowableProxy is trying to create the CacheEntry, so the same ClassLoader that loaded ThrowableProxy
should be what is being used.

> strange classloader failure
> ---------------------------
>
>                 Key: LOG4J2-1256
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1256
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.5
>            Reporter: Dan Armbrust
>
> I am utilizing log4j in a maven mojo extension (code that plugs into maven, and executes
as part of a mojo build)
> My code is encountering an internal error of its own - but when the code attempts to
log the error, this happens:
> {code}
> Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/impl/ThrowableProxy$CacheEntry
>         at org.apache.logging.log4j.core.impl.ThrowableProxy.toCacheEntry(ThrowableProxy.java:560)
>         at org.apache.logging.log4j.core.impl.ThrowableProxy.toExtendedStackTrace(ThrowableProxy.java:603)
>         at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:135)
>         at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:117)
>         at org.apache.logging.log4j.core.impl.Log4jLogEvent.getThrownProxy(Log4jLogEvent.java:482)
>         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$PatternSerializer.toSerializable(PatternLayout.java:292)
>         at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:206)
>         at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:56)
>         at org.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:148)
>         at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:112)
>         at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:152)
>         at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:125)
>         at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:116)
>         at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
>         at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:390)
>         at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:378)
>         at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:362)
>         at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:352)
>         at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
>         at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:147)
>         at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1011)
>         at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:988)
>         at org.apache.logging.log4j.spi.AbstractLogger.warn(AbstractLogger.java:1264)
>         at gov.vha.isaac.ochre.api.task.TimedTask.failed(TimedTask.java:148)
>         at javafx.concurrent.Task.setState(Task.java:708)
>         at javafx.concurrent.Task$TaskCallable.lambda$call$502(Task.java:1453)
>         at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
>         at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
>         at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
>         at com.sun.glass.ui.gtk.GtkApplication.lambda$null$50(GtkApplication.java:139)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.impl.ThrowableProxy$CacheEntry
>         at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
>         at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
>         at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
>         at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
>         ... 35 more
> {code}
> This is very odd to me, as the class not found is an inner class, inside of a class that
is obviously on the classpath (from the rest of the stack trace)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message