problem with Netty jar package conflict with HBase and Elasticsearch in one project
Use HBase in the same MAVEN project while using ES
Error after program runs
1 java.lang.NoSuchMethodError:io.netty.util.AttributeKey.newInstance (ljava/lang/string;) lio/netty/util /attributekey;
Surfing the Internet for a number of reasons, said that the Netty version of the different reasons, their own in the compiled directory also see the difference, respectively, with the 4.0.23 and 4.1.132 versions
But I don't know how to change it.
Until I met a great God and gave a solution.
Address of the Great God
hayaqi0504
The different versions of the Netty that are dependent on each other in the Pom file,
For example: My is the Netty version that HBase relies on and the difference of Elasticsearch
1. View the contents of the Pom in the terminal of idea
MVN Dependency:tree
Find different jar versions, my ES uses 4.1.13, and
2. In Pom.xml, it is mandatory to refer to Netty's dependency by using the version of ES directly, because ES uses a version that is higher than what hbase relies on.
<Dependency> <groupId>Io.netty</groupId> <Artifactid>Netty-all</Artifactid> <version>4.1.13.Final</version> </Dependency>
Note: mvn dependency:tree-dverbose-dincludes=asm:asm Similar commands can be found for duplicate jar package references
Remember the Netty Hadoop and Elasticsearch conflict jar packages