logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CEM DAYANIK (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-992) ThrowableProxy throws NoClassDefFoundError (v2.2)
Date Tue, 07 Apr 2015 04:54:12 GMT

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

CEM DAYANIK commented on LOG4J2-992:
------------------------------------

This causes unexpected behaviours.

At least Class.forName should be used with additional parameters to not to "initialize" the
class but just load.

log4j2 classes are loaded in parent classloader and so those classes shoulnt not initialize
again in parent cl.

According to trace below, it seems log4j2 tries to find about location info.
However i am not sure it is supposed to do that with our pattern usage.
It has all the information it needs.

https://logging.apache.org/log4j/2.x/manual/layouts.html#LocationInformation

{code:title=trace|borderStyle=solid}
java.lang.NullPointerException
        at cb.smg.general.utility.CBDateFactory.getDateInstance(CBDateFactory.java:111) [open_classes/:?]
        at cb.smg.general.utility.CBSystem.refresh(CBSystem.java) [open_classes/:?]
        at cb.smg.general.utility.CBSystem.refresh(CBSystem.java:144) [open_classes/:?]
        at cb.smg.general.utility.CBSystem.<clinit>(CBSystem.java:83) [open_classes/:?]
        at java.lang.J9VMInternals.initializeImpl(Native Method) [?:1.6.0]
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:201) [?:1.6.0]
        at cb.smg.general.utility.CBOIDFactory.refresh(CBOIDFactory.java:87) [open_classes/:?]
        at cb.smg.general.utility.CBOIDFactory.nextOID(CBOIDFactory.java:243) [open_classes/:?]
        at cb.smg.general.utility.CBOIDFactory.getOID(CBOIDFactory.java:60) [open_classes/:?]
        at cb.smg.general.utility.CBCacheManager.notifyCacheManager(CBCacheManager.java:622)
[open_classes/:?]
        at cb.smg.general.utility.CBCacheManager.notifyManager(CBCacheManager.java) [open_classes/:?]
        at cb.smg.general.utility.CBCache.notifyManager(CBCache.java) [open_classes/:?]
        at cb.smg.general.utility.CBMultiLangCache.refresh(CBMultiLangCache.java) [open_classes/:?]
        at cb.smg.general.utility.CBMultiLangCache.refresh(CBMultiLangCache.java:36) [open_classes/:?]
        at cb.smg.general.utility.CBMultiLangCache.<clinit>(CBMultiLangCache.java:22)
[open_classes/:?]
        at java.lang.J9VMInternals.initializeImpl(Native Method) [?:1.6.0]
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:201) [?:1.6.0]
        at cb.smg.general.utility.CBDate.<clinit>(CBDate.java:45) [open_classes/:?]
        at java.lang.J9VMInternals.initializeImpl(Native Method) [?:1.6.0]
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:201) [?:1.6.0]
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:168) [?:1.6.0]
        at java.lang.Class.forNameImpl(Native Method) [?:1.6.0]
        at java.lang.Class.forName(Class.java:182) [?:1.6.0]
        at cb.smg.general.utility.CBDateFactory.<clinit>(CBDateFactory.java:18) [open_classes/:?]
        at java.lang.J9VMInternals.initializeImpl(Native Method) [?:1.6.0]
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:201) [?:1.6.0]
        at java.lang.Class.forNameImpl(Native Method) [?:1.6.0]
        at java.lang.Class.forName(Class.java:215) [?:1.6.0]
        at org.apache.logging.log4j.core.util.Loader.initializeClass(Loader.java:251) [log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.impl.ThrowableProxy.loadClass(ThrowableProxy.java:443)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.impl.ThrowableProxy.toExtendedStackTrace(ThrowableProxy.java:572)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:117)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.impl.Log4jLogEvent.getThrownProxy(Log4jLogEvent.java:323)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:64)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:36)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:196)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:55)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:71)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:108)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:99)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:430)
[log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:409) [log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:367) [log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:112) [log4j-core-2.2.jar:2.2]
        at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:727)
[log4j-api-2.2.jar:2.2]
        at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:716)
[log4j-api-2.2.jar:2.2]
        at org.apache.logging.slf4j.Log4jLogger.error(Log4jLogger.java:318) [log4j-slf4j-impl-2.2.jar:2.2]
        at cb.smg.general.utility.CBLogManager.logException(CBLogManager.java:326) [?:?]
        at cb.smg.general.utility.CBCaller.writeLog(CBCaller.java:132) [?:?]
{code}

> ThrowableProxy throws NoClassDefFoundError (v2.2)
> -------------------------------------------------
>
>                 Key: LOG4J2-992
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-992
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2
>            Reporter: CEM DAYANIK
>
> Might be considred as duplicate of LOG4J2-834.
> log4j2 classes tries to load classes which makes "static" blocks to run.
> Out pattern is the following:
> [%d] [%-5p] [%t] [%c] - %m%n
> How can we avoid this one for now?
> According to docs, there is not any info there related to "location info"?
> Isnt this supposed to happen at least when log4j2 tries to get information about location
info?



--
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