Apache Log4j 2.0-alpha1中的错误?

时间:2012-08-13 19:14:55

标签: java exception log4j pom.xml

我使用的是Windows 7(x32),Jre7,IntellijIDEA 12。

我的pom.xml片段:

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.0-alpha1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.0-alpha1</version>
    </dependency>

我的琐碎Java课程:

// Imports omitted

public class Controller
{
    private static Logger logger = LogManager.getLogger(Controller.class.getName());

    public static void main( String[] args )
    {
        logger.error("Entering application.");
    }
}

我得到一个例外:

Exception in thread "main" java.lang.VerifyError: class org.apache.logging.log4j.core.impl.ThrowableProxy overrides final method addSuppressed.(Ljava/lang/Throwable;)V
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at org.apache.logging.log4j.core.config.LoggerConfig.createEvent(LoggerConfig.java:334)
    at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:262)
    at org.apache.logging.log4j.core.Logger.log(Logger.java:115)
    at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:965)
    at org.ruchevits.codeigniter.bootstrap.Controller.main(Controller.java:20)
    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:601)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

这个错误还是我的曲线?

1 个答案:

答案 0 :(得分:0)

我找到了答案。

bug,它将在2.0-alpha2版本中修复。

https://issues.apache.org/jira/browse/LOG4J2-64