log4j启动报错ERROR StatusLogger Unable to create Lookup for ctx

文章讲述了在项目中遇到的错误,由于Elasticsearch7.17.10依赖的log4j-core版本与log4j-api版本不一致导致的问题,解决方法是直接从依赖中排除log4j-core。
摘要由CSDN通过智能技术生成

ERROR StatusLogger Unable to create Lookup for ctx
 java.lang.NoSuchMethodError: org.apache.logging.log4j.util.LoaderUtil.getClassLoaders()[Ljava/lang/ClassLoader;
    at org.apache.logging.log4j.core.impl.ThreadContextDataInjector.getServiceProviders(ThreadContextDataInjector.java:77)
    at org.apache.logging.log4j.core.impl.ThreadContextDataInjector.<clinit>(ThreadContextDataInjector.java:64)

定位下LoaderUtil发现log4j版本不一致,log4j-core-2.17.2在调用log4j-api-2.20.0导致的,找一下作恶源,是org.elasticsearch7.17.10,用不到log4j的话直接排除掉

<dependency>
   <groupId>org.elasticsearch</groupId>
   <artifactId>elasticsearch</artifactId>
   <version>7.17.10</version>
   <exclusions>
      <exclusion>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-core</artifactId>
      </exclusion>
   </exclusions>
</dependency>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值