springboot 出现Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFound

今天建了一个springboot的项目包了很多的错,如下:

 Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.commons.logging.LogFactory$Log4jLog.(LogFactory.java:204)
at org.apache.commons.logging.LogFactory$Log4jDelegate.createLog(LogFactory.java:166)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:109)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:99)
at org.springframework.boot.SpringApplication.(SpringApplication.java:198)
at springboottext.Pub.main(Pub.java:15)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.joran.spi.JoranException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)
... 11 more
Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
at org.apache.commons.logging.LogFactory$Log4jLog.(LogFactory.java:204)
at org.apache.commons.logging.LogFactory$Log4jDelegate.createLog(LogFactory.java:166)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:109)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:99)
at org.springframework.boot.SpringApplication.(SpringApplication.java:198)
springboot 出现Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFound_第1张图片
springboot 出现Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFound_第2张图片
而且上面说的包也有没有缺的,然后我在网上查啊查没发现什么错误,我得天啊,浪费了好多时间,然后我根据jar包所在位置把仓库里的包全部删除,然后在pom.xml中添加如下

org.springframework.boot
spring-boot-starter-parent
2.0.0.RELEASE








org.springframework.boot
spring-boot-starter-web

然后保存就会去中央仓库下载下载完了就刷新一下就ok了

springboot 出现Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFound_第3张图片



你可能感兴趣的:(springboot 出现Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFound)