【发布时间】:2019-03-29 07:48:10
【问题描述】:
为了能够使用spring-geode,我需要排除starter-logging,否则我会遇到:
Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger cannot be cast to org.apache.logging.log4j.core.Logger
at org.apache.geode.internal.logging.LogService.init(LogService.java:81) ~[geode-core-1.2.1.jar:na]
at org.apache.geode.internal.logging.LogService.<clinit>(LogService.java:72) ~[geode-core-1.2.1.jar:na]
... 41 common frames omitted
我的 POM 现在看起来像这样:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.geode</groupId>
<artifactId>spring-geode-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-geode</artifactId>
<version>2.0.10.RELEASE</version>
</dependency>
我该怎么办?
【问题讨论】:
-
听起来像是日志依赖的冲突。最好将 log4j 依赖项排除在任何引入它的内容中(或者,如果您确实想使用 log4j,则排除 log4j-over-slf4j)。
-
请在发帖前花时间正确格式化所有内容。
标签: java spring spring-boot geode