Maven依赖中有包,但没有找到程序想要的类

目录

1、问题

2、分析

3、解决

———————————————————————————–

1、问题

问题: 在com.lmax.disruptor 3.3.0 包中找不到com.lmax.disruptor.dsl.Disruptor类.

Caused by: java.lang.NoSuchMethodError: com.lmax.disruptor.dsl.Disruptor.(Lcom/lmax/disruptor/EventFactory;ILjava/util/concurrent/ThreadFactory;Lcom/lmax/disruptor/dsl/ProducerType;Lcom/lmax/disruptor/WaitStrategy;)V
    at org.apache.phoenix.log.QueryLoggerDisruptor.(QueryLoggerDisruptor.java:71)
    at org.apache.phoenix.query.ConnectionQueryServicesImpl.(ConnectionQueryServicesImpl.java:414)
    at org.apache.phoenix.jdbc.PhoenixDriver$3.call(PhoenixDriver.java:248)
    at org.apache.phoenix.jdbc.PhoenixDriver$3.call(PhoenixDriver.java:241)
    at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4791)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3584)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2372)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2335)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2250)

Maven依赖中有包,但没有找到程序想要的类_第1张图片

2、分析

1、主要是版本不对,因为hbase-server间接依赖[com.lmax.disruptor]包
2、查看依赖树 : mvn dependency:tree
Maven依赖中有包,但没有找到程序想要的类_第2张图片

3、解决

1、换一个版本的jar包.查看依赖树发现hbase-server不间接依赖[com.lmax.disruptor]包

<dependency>
     <groupId>com.lmaxgroupId>
     <artifactId>disruptorartifactId>
     <version>3.3.8version>
dependency>

2、查看依赖树 : mvn dependency:tree
Maven依赖中有包,但没有找到程序想要的类_第3张图片

你可能感兴趣的:(【工具】maven)