赞
踩
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.commons.logging.LogAdapter$Log4jLog.<init>(LogAdapter.java:165)
at org.apache.commons.logging.LogAdapter$Log4jAdapter.createLog(LogAdapter.java:122)
at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:89)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:67)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:59)
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:196)
at com.zone.gateway.SigmaGatewayApplication.main(SigmaGatewayApplication.java:17)
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 8 more
修改pom.xml中slf4j依赖配置:
原来:
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>provided</scope>
- </dependency>
改为下面配置:
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.25</version>
- </dependency>
- <!-- This is used for slf4j binding with log4j -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.7.25</version>
- <scope>test</scope>
- </dependency>
参考资料:
https://www.5axxw.com/questions/content/ve908qhttps://www.5axxw.com/questions/content/ve908qidea环境配置如下:
采用jdk11,启动正常。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。