elasticsearch-cluster-runner
elasticsearch-cluster-runner copied to clipboard
cannot access org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse
Hi,
I am using elastic search 6.5.4 and added below dependency in pom.xml
Please let me know the solution.
Try version 6.5.4.0.
you mean elastic search or codelibs version
elasticsearch-cluster-runner 6.5.4.0 is for elasticsearch 6.5.4.
Thank you,
I have an other issue with this
2019-01-17 11:39:14,059 main ERROR LogManager returned an instance of org.apache.logging.slf4j.SLF4JLoggerContextFactory which does not implement org.apache.logging.log4j.core.impl.Log4jContextFactory. Unable to initialize Log4j.
Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:142) at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:119) at org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner.buildNodeSettings(ElasticsearchClusterRunner.java:496) at org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner.build(ElasticsearchClusterRunner.java:384) ... 15 more
Is there any work around for this issue, please let me know
You can check dependencies for this project in pom.xml. It's better to check your dependencies in your project.
I have taken all the dependencies from this project pom.xml, but still I am getting this error
I could not reproduce it. Could you provide steps or all code to reproduce it.
I had the same problem too. I am using Spring Data Elasticsearch. In a Spring Boot project. The problem is that spring-boot-starter pulls in spring-boot-starter-logging. If you exclude it, it works. This is the relevant part of my pom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codelibs</groupId>
<artifactId>elasticsearch-cluster-runner</artifactId>
<version>6.8.4.0</version>
<scope>test</scope>
</dependency>
An interesting observation: The spring-data-elasticsearch release train working with the current spring boot version (2.2) pulls in Elasticsearch 6.8.5 but there is no corresponding elasticsearch-cluster-runner version.
Thank You for your Work!
@wallner - it is easy. Elasticsearch-cluster-runner works only with log4j. It depends on log4j-core and uses the log4j core classes in runtime. Spring boot starter logger add to the classpath SLF4j bridge that causes exception above
We shouldn't have to change our applications logging implementation in order to use this library.
It will be great if Elasticsearch-cluster-runner will not depend on log4j implementation. Only on log4j interfaces. It will allow to use it without patching sources each time than I need to run integration tests in spring boot application.
See https://stackoverflow.com/questions/54036773/unable-to-initialize-log4j-slf4jloggercontextfactory for example