Remember the Netty Hadoop and Elasticsearch conflict jar packages

Source: Internet
Author: User

problem with Netty jar package conflict with HBase and Elasticsearch in one project
    • Event:

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

    • Reason:

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

    • Workaround:

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.