Idea project start error, log package conflicts slf4j and logback conflicts
The error is as follows
SLF4J: Found binding in [jar:file:/E:/maven_dev/maven_3/apache-maven-3.5.2/repo/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.!/org/slf4j/impl/] SLF4J: Found binding in [jar:file:/E:/maven_dev/maven_3/apache-maven-3.5.2/repo/org/slf4j/slf4j-log4j12/1.7.29/slf4j-log4j12-1.7.!/org/slf4j/impl/] Caused by: : LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org..Log4jLoggerFactory loaded from file:/E:/maven_dev/maven_3/apache-maven-3.5.2/repo/org/slf4j/slf4j-log4j12/1.7.29/slf4j-log4j12-1.7.). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/: org..Log4jLoggerFactory
SLF4J: Found binding in [jar:file:/E:/maven_dev/maven_3/apache-maven-3.5.2/repo/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.!/org/slf4j/impl/]
SLF4J: Found binding in [jar:file:/E:/maven_dev/maven_3/apache-maven-3.5.2/repo/org/slf4j/slf4j-log4j12/1.7.29/slf4j-log4j12-1.7.!/org/slf4j/impl/]
Add in
<dependency> <groupId></groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> </dependency>
<dependency> <groupId></groupId> <artifactId>spring-boot-starter-web</artifactId> <!--Resolve log package conflicts--> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> </exclusions> </dependency>
Adjust according to your version
<!--Add tozookeeperVersion,Consistent with the virtual machine--> <dependency> <groupId></groupId> <artifactId>zookeeper</artifactId> <version>3.4.9</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> </exclusions> </dependency>
Start OK!!!
Summarize
The above is personal experience. I hope you can give you a reference and I hope you can support me more.