Felix Novovic Felix Novovic - 1 year ago 79
Java Question

ElasticsearchIntegrationTest fails with a NullPointerException

I'm using elasticsearch for a project I'm working on but, unfortunately, having quite frustrating issues with the test setup.

I have a test class which looks like below

import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.junit.Test;

public class JavaTest extends ElasticsearchIntegrationTest {

public void testSomething() throws Exception {


This is my build.sbt

"org.elasticsearch" % "elasticsearch" % "1.7.2" % "test" classifier "tests",
"com.carrotsearch.randomizedtesting" % "randomizedtesting-runner" % "2.1.17" % "test",
"org.elasticsearch" % "elasticsearch" % "1.7.2",
"org.apache.lucene" % "lucene-test-framework" % "4.10.4" % "test",
"org.hamcrest" % "hamcrest-all" % "1.3"

This is the output from the console

Oct 21, 2015 4:20:27 PM com.carrotsearch.randomizedtesting.RandomizedRunner runSuite
SEVERE: Panic: RunListener hook shouldn't throw exceptions.
at org.elasticsearch.test.junit.listeners.LoggingListener.testRunStarted(LoggingListener.java:50)
at com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:639)
at com.carrotsearch.randomizedtesting.RandomizedRunner.access$200(RandomizedRunner.java:140)
at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:587)

I have no idea what is going on here, the documentation told me only to inherit the ElasticsearchIntegrationTest class and I'd be good to go.

Does anyone have any idea as to what's going on here? Information about this error is very scarce and I did not find anything useful.

Answer Source

Judging by http://central.maven.org/maven2/org/elasticsearch/elasticsearch/1.7.2/elasticsearch-1.7.2.pom, I think you have the wrong version of carrotsearch. I think you need 2.1.2

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download