Application throws java.lang.ClassNotFoundException: org.elasticsearch.plugins.NetworkPlugin. In the pom I added two dependencies:
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.1.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.1.1</version>
</dependency>
private static final String SERVER_IP = "127.0.0.1";
private static final Integer SERVER_PORT = 9300;
@Bean
public TransportClient transportClient() throws UnknownHostException {
return new PreBuiltTransportClient(Settings.EMPTY).addTransportAddress(
new TransportAddress(InetAddress.getByName(SERVER_IP), SERVER_PORT));;
}
Before this post I deleted all files inside .m2 folder and reimport all dependencies. Anybody has idea where can be a problem?
Today I focused on available maven repository for this project and found two different dependencies, but I can't find older version in maven pom. I attach image with print screen: ibb.co/mUgU4G . Older elasticsearch version is marked as parent and is a third party pom. Thank you for reply
dependencyTreeMain - dependency report from the whole project (dependency:tree), pomCore file - it is a module where I have implement TransportClient to Elasticsearch.
org.elasticsearch.client:transport:6.1.1 has org.elasticsearch:elasticsearch:2.4.6
Problem should be easier to find. Additionally in the project I am using Spring Boot.
Problem has been resolved: Spring Boot has default elasticsearch version below 5.0.0. The solution was by adding properties with version Elasticsearch, which we want to use in application. @dadoonet, thank you very much. You have been right about the conflict of dependencies Spring.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.