Exception in thread "main" java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.debug(Ljava/lang/String;Ljava/lang/Object;)V

Trying to upgrade elastic version from 2.4 to 5.6.16

Maven Dependency

<log4j.version>2.11.1</log4j.version>
<jboss_logging.version>3.2.1.Final</jboss_logging.version>
<logback.version>1.1.3</logback.version>
<slf4j.version>1.7.21</slf4j.version>
<jackson.version>2.6.3</jackson.version>
<jetty.version>9.2.13.v20150730</jetty.version>
<dropwizard.version>0.9.2</dropwizard.version>
<mysql_connector.version>5.1.35</mysql_connector.version>
<sqlserver_connector.version>4.0</sqlserver_connector.version>
<elasticsearch.version>5.6.16</elasticsearch.version>
<apache_commons_io.version>2.4</apache_commons_io.version>
<jsoup.version>1.8.3</jsoup.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<junit.version>4.12</junit.version>
<mockito.version>2.7.22</mockito.version>

Additional Dependency

org.elasticsearch.client transport ${elasticsearch.version}

Error

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.debug(Ljava/lang/String;Ljava/lang/Object;)V

at org.elasticsearch.threadpool.ThreadPool.(ThreadPool.java:203)

at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:132)

at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:268)

at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:133)

at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:119)

at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:109)

Welcome!

Please read this about how to format and then update your question.

Provide your pom.xml or better a simplified one so any java dev can reproduce the problem. You can share a sample project on Github so that easy to clone and reproduce.

BTW 5.6 is EOL. You should go to 6.x or better use the 7.2 version and switch to the Rest client as the Transport Client has been deprecated and will be removed in 8.x.

Thanks for your response.
I'll first try to upgrade to 7.2, still if I face issue I'll share sample project on Github.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.