prestodb / presto-hive-apache

Shaded version of Apache Hive for Presto

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency Conflict: Conflicting classes in different JARs

PandaMonkey opened this issue · comments

Hi, by analyzing your source code, we found there are conflicting classes in your two third party libraries: org.apache.thrift:libthrift:0.9.1 and org.apache.hive:hive-exec:1.2.2.
The root cause is that org.apache.hive:hive-exec:1.2.2 is a repackage JAR, and it contains org.apache.thrift:libthrift:0.9.2. However, your project directly depends on org.apache.thrift:libthrift:0.9.1. These two versions are incompatible. As libthrift is first declared on the classpath, the conflicting classes in libthrift will override those of hive-exec. As the JVM only load the classes present first on the classpath and shadow the other duplicate ones, so this problem brings high risk of NoSuchMethodError or NoSuchMethodExceptions at runtime. The detail conflicting information is listed below. Please pay attention about that. Maybe the solution is upgrading thrift:libthrift from 0.9.1 to 0.9.2. Hope this report can help you. Thanks!

Methods that only exist in org.apache.thrift:libthrift:0.9.1:: [com.facebook.presto.hive:hive-apache:1.2.2-1::null->org.apache.thrift:libthrift:0.9.1::compile]
<org.apache.thrift.TMultiplexedProcessor$StoredMessageProtocol: void (org.apache.thrift.TMultiplexedProcessor,org.apache.thrift.protocol.TProtocol,org.apache.thrift.protocol.TMessage)>
<org.apache.thrift.TNonblockingMultiFetchClient: org.apache.log4j.Logger access$400()>
<org.apache.thrift.protocol.TCompactProtocol$Factory: void (int)>
<org.apache.thrift.protocol.TCompactProtocol: void checkReadLength(int)>
<org.apache.thrift.protocol.TField: boolean equals(org.apache.thrift.protocol.TField)>
<org.apache.thrift.protocol.TMessage: boolean equals(org.apache.thrift.protocol.TMessage)>
<org.apache.thrift.server.TThreadedSelectorServer$SelectorThreadLoadBalancer: void (org.apache.thrift.server.TThreadedSelectorServer,java.util.Collection)>
<org.apache.thrift.transport.TFileTransport: org.apache.thrift.transport.TFileTransport$tailPolicy getTailPolicy()>
<org.apache.thrift.transport.TFileTransport: org.apache.thrift.transport.TFileTransport$tailPolicy setTailPolicy(org.apache.thrift.transport.TFileTransport$tailPolicy)>
<org.apache.thrift.transport.TFileTransport: int tailRead(java.io.InputStream,byte[],int,int,org.apache.thrift.transport.TFileTransport$tailPolicy)>
<org.apache.thrift.transport.TSaslTransport: void sendAndThrowMessage(org.apache.thrift.transport.TSaslTransport$NegotiationStatus,java.lang.String)>

Methods that only exist in org.apache.hive:hive-exec:1.2.2:: [com.facebook.presto.hive:hive-apache:1.2.2-1::null->org.apache.hive:hive-exec:1.2.2::compile]
<org.apache.thrift.TByteArrayOutputStream: void reset()>
<org.apache.thrift.TDeserializer: void deserialize(org.apache.thrift.TBase,byte[],int,int)>
<org.apache.thrift.TMultiplexedProcessor$StoredMessageProtocol: void (org.apache.thrift.protocol.TProtocol,org.apache.thrift.protocol.TMessage)>
<org.apache.thrift.TNonblockingMultiFetchClient: org.slf4j.Logger access$400()>
<org.apache.thrift.protocol.TBinaryProtocol$Factory: void (boolean,boolean,long,long)>
<org.apache.thrift.protocol.TBinaryProtocol: void checkStringReadLength(int)>
<org.apache.thrift.protocol.TBinaryProtocol: void checkContainerReadLength(int)>
<org.apache.thrift.protocol.TBinaryProtocol: void (org.apache.thrift.transport.TTransport,long,long,boolean,boolean)>
<org.apache.thrift.protocol.TCompactProtocol$Factory: void (long,long)>
<org.apache.thrift.protocol.TCompactProtocol$Factory: void (long)>
<org.apache.thrift.protocol.TCompactProtocol: void (org.apache.thrift.transport.TTransport,long,long)>
<org.apache.thrift.protocol.TCompactProtocol: void checkContainerReadLength(int)>
<org.apache.thrift.protocol.TCompactProtocol: void checkStringReadLength(int)>
<org.apache.thrift.protocol.TField: boolean equals(java.lang.Object)>
<org.apache.thrift.protocol.TField: int hashCode()>
<org.apache.thrift.protocol.TJSONProtocol$Factory: void (boolean)>
<org.apache.thrift.protocol.TJSONProtocol: void (org.apache.thrift.transport.TTransport,boolean)>
<org.apache.thrift.protocol.TMessage: int hashCode()>
<org.apache.thrift.protocol.TSimpleJSONProtocol$Context: boolean isMapKey()>
<org.apache.thrift.protocol.TSimpleJSONProtocol: byte[] access$100()>
<org.apache.thrift.protocol.TSimpleJSONProtocol: byte[] access$000()>
<org.apache.thrift.protocol.TSimpleJSONProtocol: void assertContextIsNotMapKey(java.lang.String)>
<org.apache.thrift.server.TNonblockingServer$SelectAcceptThread: org.apache.thrift.server.AbstractNonblockingServer$FrameBuffer createFrameBuffer(org.apache.thrift.transport.TNonblockingTransport,java.nio.channels.SelectionKey,org.apache.thrift.server.AbstractNonblockingServer$AbstractSelectThread)>
<org.apache.thrift.server.TThreadPoolServer$Args: org.apache.thrift.server.TThreadPoolServer$Args beBackoffSlotLengthUnit(java.util.concurrent.TimeUnit)>
<org.apache.thrift.server.TThreadPoolServer$Args: org.apache.thrift.server.TThreadPoolServer$Args requestTimeoutUnit(java.util.concurrent.TimeUnit)>
<org.apache.thrift.server.TThreadPoolServer$Args: org.apache.thrift.server.TThreadPoolServer$Args requestTimeout(int)>
<org.apache.thrift.server.TThreadPoolServer$Args: org.apache.thrift.server.TThreadPoolServer$Args beBackoffSlotLength(int)>
<org.apache.thrift.server.TThreadedSelectorServer$SelectorThread: org.apache.thrift.server.AbstractNonblockingServer$FrameBuffer createFrameBuffer(org.apache.thrift.transport.TNonblockingTransport,java.nio.channels.SelectionKey,org.apache.thrift.server.AbstractNonblockingServer$AbstractSelectThread)>
<org.apache.thrift.server.TThreadedSelectorServer$SelectorThreadLoadBalancer: void (java.util.Collection)>
<org.apache.thrift.transport.TFileTransport: int tailRead(java.io.InputStream,byte[],int,int,org.apache.thrift.transport.TFileTransport$TailPolicy)>
<org.apache.thrift.transport.TFileTransport: org.apache.thrift.transport.TFileTransport$TailPolicy setTailPolicy(org.apache.thrift.transport.TFileTransport$TailPolicy)>
<org.apache.thrift.transport.TFileTransport: org.apache.thrift.transport.TFileTransport$TailPolicy getTailPolicy()>
<org.apache.thrift.transport.TNonblockingServerSocket: int getPort()>
<org.apache.thrift.transport.TNonblockingServerSocket: void (org.apache.thrift.transport.TNonblockingServerSocket$NonblockingAbstractServerSocketArgs)>
<org.apache.thrift.transport.TSaslTransport: org.apache.thrift.transport.TTransportException sendAndThrowMessage(org.apache.thrift.transport.TSaslTransport$NegotiationStatus,java.lang.String)>
<org.apache.thrift.transport.TServerSocket: void (org.apache.thrift.transport.TServerSocket$ServerSocketTransportArgs)>