maven 创建geode ClientCacheFactory对象时出现ClassCastException

6uxekuva  于 2023-10-17  发布在  Maven
关注(0)|答案(1)|浏览(96)

我正在使用gemfire,并尝试在我的maven项目中使用apache geode加载客户端缓存。创建ClientCacheFactory时,我收到一个ClassCastException

java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger cannot be cast to org.apache.logging.log4j.core.Logger
  at org.apache.geode.logging.log4j.internal.impl.Log4jLoggingProvider.getRootLoggerContext(Log4jLoggingProvider.java:105) ~[geode-log4j-9.10.5.jar:na] 

  at org.apache.geode.logging.log4j.internal.impl.Log4jloggingProvider.getConfiguration (Log4jloggingProvider. java:109) ~[geode-log4j-9.10.5.jar:na]

at org.apache.geode.logging.log4j.internāl.impl.log4jloggingProvider.isUsingGemFireDefaultConfig (Log4jloggingProvider.java:94) ~[geode-log4j-9.10.5.jar:na]

at org.apache.geode.logging.log4j.internal.impl.Log4jloggingProvider.shouldUpdateLoglevels (Log4jloggingProvider.java:143) ~[geode-logj-9.10.5.jar:na]

at org.apache.geode.logging.log4j.internal.impl.log4jloggingProvider.configure (Log4jLoggingProvider.Java:121) "[geode-log4j-9.10.5.jar:na]

at org.apache.geode.logging.internal.Configuration.configChanged (Configuration. Java:143) " [geode-core-9.10.5.jar:na]

at org.apache.geode.logging.internal.Configuration. initialize (Configuration.java:132) " [geode-core-9.10.5.jar:na]

at org.apache.geode.logging.internal.LoggingSession.createSession (LoggingSession.java:69) "[geode-core-9.10.5.jar:na]

at org.apache.geode.distributed.internal.InternalDistributedSystem.initialize (InternalDistributedSystem. java:704) ~[geode-core-9.10.5.jar:na]

at org.apache.geode.distributed.internal. InternalDistributedSystem.access$200 (InternalDistributedSystem. java:135) ~[geode-core-9.10.5.]ar:na

at org.apache.geode.distributed.internal. InternalDistributedSystemșBuilder.build (InternalDistributedSystem. java:3036) ~[geode-core-9.10.5.jar:na]

at org.apache.geode.distributed. internal.InternalDistributedSystem.connectInternal (InternalDistributedSystem.java:290) ~[geode-core-9.10.5.jar:na]

at org.apache.geode.distributed.înternal.InternalDistributedSystem.connectInternal (InternalDistributedsystem. java:216) ~[geode-core-9.10.5.jar:na]

at org.apache.geode.cache.client.ClientCacheFactory.connectInternalDistributedSystem (ClientCacheFactory. java:280) ~ [geode-core-9.10.5.jar:na]

at org.apache.geode.cache.client.ClientCacheFactory.basicCreate (ClientCacheFactory.java:250) - [geode-core-9.10.5.jar:na]

at org.apache.geode.cache.client.ClientCacheFactory.create (ClientCacheFactory. java:216) "[geode-core-9.10.5.jar:na]
.....

我已经尝试删除log4j-over-slf 4j,log4j-api和log4j-core,并尝试添加slf 4j-log4j 12,但我仍然得到这个异常。现在我知道geode-core内部包含log4j,所以我也排除了log4j和log4j-to-slf 4j依赖。但问题仍然存在。如果我能得到一些指针来重新分级异常,那将非常有帮助。
目前我有以下依赖项:1.log4j-slf4j-impl 2.log4j-api 3.log4j-core 4.log4j-over-slf4j 5.slf4j-api 6.slf4j-log4j12
我使用的是geode-core-9.10.5,同时包含geode-log4j和geode-logging。

bnlyeluc

bnlyeluc1#

对于将来可能面临这个问题的人来说,这是因为geode-log4j jar。我有另一个文件夹,我在项目中添加slf 4j jar。由于技术原因,我不允许删除这些。一旦我删除了jar,这个异常就消失了。

相关问题