spring boot 启动报 java.lang.NoClassDefFoundError: ch/qos/logback/core/spi/LifeCycle 错误
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: ch/qos/logback/core/spi/LifeCycle
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:)
at java.net.URLClassLoader.access$(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:)
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:)
at com.cfj.testboot.Application.main(Application.java:)
解决:这个问题的根本原因是类路径中不存在所需的jar。请添加以下依赖项——它们将解决您的问题。
再pom.xml中增加:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> </exclusion>
</exclusions>
</dependency> <dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency>
spring boot 启动报 java.lang.NoClassDefFoundError: ch/qos/logback/core/spi/LifeCycle 错误的更多相关文章
- java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
问题描述:启动tomcat服务器的时候,报找不到JoranException类的异常 原因:tomcat中没有logback-core-1.1.2.jar包 解决方法:在tomcat中的lib目录添加 ...
- 解决java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/Pattern
明明引入了这个,却提示没有 看下面文章: http://www.maocaoying.com/article/109
- 解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level
解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level 学习了:https://blog.csdn. ...
- spring boot启动STS 运行报错 java.lang.NoClassDefFoundError: ch/qos/logback/classic/LoggerContext
spring boot启动STS 运行报错 java.lang.NoClassDefFoundError: ch/qos/logback/classic/LoggerContext 学习了: http ...
- springBoot报错Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level
解决办法: 如果使用的是阿里云 maven 镜像,在这会有找不到最新 Springboot 相关包的问题,请把加速镜像指向华为云: <mirror> <id>huaweiclo ...
- Spring Boot 启动的时候遇到 java.lang.ClassNotFoundException: ch.qos.logback.classic.Level
在刚开始接触spring boot的时候,想创建一个Hello World 的project. 但是创建完之后,Run as 'Spring Boot APP'的时候遇到这个错误. Level类存在于 ...
- Spring整合Mybatis报 java.lang.ClassNotFoundException:org.springframework.core.metrics.ApplicationStartup,即:spring的版本过高,采用RELEASE稳定版
1.遇到的问题: 今天在弄spring整合mybatis的时候遇到一个小问题,如图所示: 简单来说:就是我的spring的xml文件没找到,我就奇了怪了,我所有的配置都没问题啊! 我pom.xml配置 ...
- spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes
spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...
- Spring boot启动时报 java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long错误
Spring boot启动时报 java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be ...
随机推荐
- Number of Parallelograms CodeForces - 660D (几何)
Number of Parallelograms CodeForces - 660D You are given n points on a plane. All the points are dis ...
- QOpenGLWidget
QOpenGLWidget描述 QOpenGLWidget类是用于渲染OpenGL图形. 除了可以选择使用QPainter和标准的OpenGL渲染图形,QOpenGLWidget类提供了在Qt应用程序 ...
- git 学习使用记录
一.一个小时学会git:https://www.cnblogs.com/best/p/7474442.html 二.fetch fatal: Refusing to fetch into curren ...
- 通过url下载文件到指定目录 java
import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io ...
- Flutter入门(三)-底部导航+路由
* StatefulWidget 如果想改变页面中的数据就要用到StatefulWidget,之前自定义组件继承的StatelessWidget是不能动态修改页面数据的 //自定义有状态组件 clas ...
- 运行一次node服务后,再次运行报错
由于工作内容在git上,而系统又是window,大家知道,window自带的终端是不能进行git操作的,所以下载了一个git进行代码的更新提交. 我在git上运行了node服务后,由于不同的项目,我需 ...
- Ion-select and ion-option list styling 自定义样式
https://forum.ionicframework.com/t/ion-select-and-ion-option-list-styling/117028
- 坚果Pro2刷魔趣系统教程,刷回锤子系统教程
一.刷魔趣系统 1.高通驱动安装 https://blog.csdn.net/qq_43653944/article/details/86702169 2.刷入twrp rec https://blo ...
- react-native 各种插件
https://www.cnblogs.com/skylor/p/5783824.html
- python版本升级流程,升级2.7跟3.x版本流程一样
前言: 目前python2.6版本很多库已经不支持,在安装库的时候总会遇到很多装不上的事故,特别烦恼,所以以后不纠结,直接升级python版本后再使用,避免多次采坑:当然,未来趋势还是python3. ...