NoClassDefFoundError
现象
SpringBoot在运行的时候会出现NoClassDefFoundError: org/apache/juli/logging/LogFactory的错误,
具体错误内容如下:
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
原因
这是因为没有juli.jar导致的
解决方式
加入对应 jar 即可
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-juli</artifactId>
<version>7.0.27</version>
</dependency>
参考资料
更多学习
更多实时资讯,前沿技术,生活趣事。尽在【老马啸西风】
交流社群:[交流群信息](https://mp.weixin.qq.com/s/rkSvXxiiLGjl3S-ZOZCr0Q)