NoClassDefFoundError
现象
SpringBoot在运行的时候会出现NoClassDefFoundError: org/apache/juli/logging/LogFactory的错误,
具体错误内容如下:
[plaintext]
1org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
原因
这是因为没有juli.jar导致的
解决方式
加入对应 jar 即可
[xml]
1
2
3
4
5<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-juli</artifactId>
<version>7.0.27</version>
</dependency>