gpt4 book ai didi

maven - 使用 maven 和 spring boot 在类路径上检测到 log4j-over-slf4j.jar 和 slf4j-log4j12.jar

转载 作者:行者123 更新时间:2023-12-03 18:19:26 25 4
gpt4 key购买 nike

我不知道我该如何解决这个问题。请看一看,如果可能的话,让我如何解决它。这是我的 pom.xml 文件。

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-compiler-2.1</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.8.9.1</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>15.0</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-compiler-2.0</artifactId>
<version>2.0.3</version>
</dependency>

<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-compiler-1.9</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
</dependency>


</dependencies>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>com.bluepi.util.backup.glacier.Application</start-class>
<java.version>1.7</java.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>

我基本上收到以下错误:

Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.



另见 http://www.slf4j.org/codes.html#log4jDelegationLoop了解更多详情。

最佳答案

转到您的 pom.xml 并在底部选项卡上单击“Dependency Hierarchy”选项卡。从那里搜索 log4j-over-slf4j。排除此依赖项的所有实例(右键单击该实例并“排除 Maven Artifact”)。在您不再出现 log4j-over-slf4j 并重新保存后,尝试运行该程序。如果它仍然不起作用,则撤消您刚刚所做的更改(在开始时备份您的 pom.xml 可能是明智的)并排除 slf4j-log4j12 的所有实例。

我在使用 Apache Storm 时遇到了同样的问题。 . .为什么一个可能工作而不是另一个的一个例子是 Storm 如何在运行时拉入 log4j-over-slf4j,尽管我将“排除 log4j-over-slf4j”添加到了 Storm-core 依赖项

关于maven - 使用 maven 和 spring boot 在类路径上检测到 log4j-over-slf4j.jar 和 slf4j-log4j12.jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25737207/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com