java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
sh_man 提问于:2017-04-13
0 0

jetty web 项目启动报错:

console如下:

Caused by: org.apache.ibatis.logging.LogException: Error setting Log implementation.  Cause: java.lang.reflect.InvocationTargetException
    at org.apache.ibatis.logging.LogFactory.setImplementation(LogFactory.java:139)
    at org.apache.ibatis.logging.LogFactory.useCustomLogging(LogFactory.java:89)
    at org.apache.ibatis.session.Configuration.setLogImpl(Configuration.java:222)
    at com.baomidou.mybatisplus.MybatisXMLConfigBuilder.settingsElement(MybatisXMLConfigBuilder.java:273)
    at com.baomidou.mybatisplus.MybatisXMLConfigBuilder.parseConfiguration(MybatisXMLConfigBuilder.java:123)
    ... 83 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.ibatis.logging.LogFactory.setImplementation(LogFactory.java:133)
    ... 87 more
Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
    at org.apache.ibatis.logging.log4j2.Log4j2Impl.<init>(Log4j2Impl.java:31)
    ... 92 more
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
    ... 93 more
  • 所有回答
bluesky 回答于:2017-06-04
0 0

查看maven是否有如下依赖

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.7</version>
</dependency>
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-jcl</artifactId>
    <version>2.7</version>
</dependency>
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-slf4j-impl</artifactId>
    <version>2.7</version>
</dependency>
我来回答    java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager