Spring boot application failed to start due to : Failed to instanceiate SLF4J LoggerFactory Reported

编程入门 行业动态 更新时间:2024-10-24 02:27:26
本文介绍了Spring boot application failed to start due to : Failed to instanceiate SLF4J LoggerFactory Reported的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在编写示例代码,但在启动 Spring Boot 应用程序时出现以下错误,我已粘贴完整的错误堆栈和使用的 pom 文件.

I was working on a sample code and I get the following error when starting the spring boot application I have pasted the complete error stack and the pom file used.

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.apachemons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) at org.apachemons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132) at org.apachemons.logging.LogFactory.getLog(LogFactory.java:273) at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:191) at com.hellokoding.auth.WebApplication.main(WebApplication.java:16) Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.joran.spi.JoranException at java.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 9 more

pom.xml 是

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="maven.apache/POM/4.0.0" xmlns:xsi="www.w3/2001/XMLSchema-instance" xsi:schemaLocation="maven.apache/POM/4.0.0 maven.apache/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>auth</artifactId> <name>auth</name> <description>auth</description> <packaging>war</packaging> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.5.RELEASE</version> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.8</java.version> </properties> ................. </project>

如果我将 1.3.5.RELEASE 更改为 1.3.2.RELEASE 它工作正常.我不明白为什么会发生这种情况,谁能解释一下

If I change the 1.3.5.RELEASE to 1.3.2.RELEASE it works fine. I do not understand why this happen can anybody please explain

推荐答案

我在使用 1.4.2.RELEASE 时遇到了同样的问题.似乎以某种方式在 logback-core jar 中缺少某些类,这可能是启动 springboot 应用程序所需的.因此,我搜索了 logback 核心 jar 并将 maven 依赖项粘贴到我的 pom.xml 文件中,然后我的 spring-boot 启动了.如果需要,请确保清理项目.我的 pom 如下所示:-

I was facing the same issue while I was using 1.4.2.RELEASE. It seems that somehow some classes are missing in logback-core jar which may be required to start the springboot application. so, I searched for logback core jar and pasted the maven dependency in my pom.xml file and my spring-boot started. Make sure to clean the project, if required. My pom is as given below:-

<modelVersion>4.0.0</modelVersion> <groupId>io.javavbrains.springbpptquickstart</groupId> <artifactId>CourseApi</artifactId> <version>0.0.1-SNAPSHOT</version> <name>Java Brains Course API</name> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.2.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>1.2.3</version> </dependency> </dependencies> <properties> <java.version>1.8</java.version> </properties>

更多推荐

Spring boot application failed to start due to : Failed to instanceiate SLF4J Lo

本文发布于:2023-11-14 10:18:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586953.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:failed   start   application   Spring   boot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!