You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Pradeep Shankar (JIRA)" <ji...@apache.org> on 2019/01/23 14:27:00 UTC
[jira] [Commented] (LOG4J2-2266) Log4j2 throws NoClassDefFoundError
in Java 8
[ https://issues.apache.org/jira/browse/LOG4J2-2266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16750043#comment-16750043 ]
Pradeep Shankar commented on LOG4J2-2266:
-----------------------------------------
[~ralph.goers@dslextreme.com] this continues to be a open item with JDK 8 and log4j 2.11.0. We also have a powermock which uses custom class loader to load specific classes and fails to initialize.
[ERROR] Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.util.PropertiesUtil
[ERROR] at org.apache.logging.log4j.status.StatusLogger.<clinit>(StatusLogger.java:78)
[ERROR] at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:60)
NOTE: tests with 2.11.1 and JDK8 also fails with the same error.
We see that LOG4j2-2129 has been fixed under - [https://blogs.apache.org/logging/entry/log4j-2-11-released.] However, it does not seem to be working for jdk8 combination.
> Log4j2 throws NoClassDefFoundError in Java 8
> --------------------------------------------
>
> Key: LOG4J2-2266
> URL: https://issues.apache.org/jira/browse/LOG4J2-2266
> Project: Log4j 2
> Issue Type: Bug
> Affects Versions: 2.10.0
> Reporter: Andrejus Chaliapinas
> Priority: Major
>
> During Unit Tests run using JDK 8 and Log4j2 v2.10.0 - getting this as part of exception stack:
>
> java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.logging.log4j.util.PropertiesUtil
> at org.apache.logging.log4j.status.StatusLogger.<clinit>(StatusLogger.java:71)
> at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:60)
>
> and issue seems to be somehow related to what is reported so far against JDK 9 here: LOG4J2-2129.
>
> If some patch on top of v2.10.0 is available to test - please let me know where to download it from.
>
> While running same UTs with same JDK 8 and v2.8.2 - issue is not observed.
>
> And question which I have here - why not introduce JDK8 compatibility runtime mode while things with JDK9 are not yet that stable? So it could continue use same logic as of v2.8.2 around that ServiceLoader and not cause side effects.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)