springboot 版本1.5.4 版本低 logback 升级1.3以上项目启动冲突Exception in thread “main“

时间:2025-04-02 07:22:21

直接pom文件引入logback1.3.7版本

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.5</version>
</dependency>
<dependency>
    <groupId></groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.3.7}</version>
</dependency>
<dependency>
    <groupId></groupId>
    <artifactId>logback-core</artifactId>
    <version>1.3.7</version>
</dependency>

这时候启动就会报错Exception in thread "main"  

需要在启动类加入:

("", "none");

import ;
import ;
import ;

@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
	public static void main(String[] args) {
		try {
			("", "none");
			(, args);
			("====================启动成功====================");

		}catch (Exception e){
			(e);
		}
	}
}

这时候启动就可以了