allegro / embedded-elasticsearch

Tool that ease up creation of integration tests with Elasticsearch
Apache License 2.0
269 stars 81 forks source link

Elastic search fails to start #77

Open sheldon-sminq opened 5 years ago

sheldon-sminq commented 5 years ago

I am getting the following errors

Server is started as follows

 ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("search-index/search-settings.json").getFile());
            File places = new File(classLoader.getResource("search-index/places.json").getFile());
            File users = new File(classLoader.getResource("search-index/users.json").getFile());
            InputStream settings = new FileInputStream(file);
            InputStream placeStream = new FileInputStream(places);
            InputStream userStream = new FileInputStream(users);

            SEARCH = EmbeddedElastic.builder()
                    .withElasticVersion("5.5.1")
                    .withSetting(PopularProperties.HTTP_PORT, 9350)
                    .withPlugin("analysis-stempel")
                    .withEsJavaOpts("-Xms128m -Xmx512m")
                    .withIndex("sminq", IndexSettings.builder()
                            .withSettings(settings)
                            .withType("places",placeStream)
                            .withType("users",userStream).build())
                    .build()
                    .start();
            SEARCH.start();

Error

 Elasticsearch failed java.lang.RuntimeException: Call to elasticsearch resulted in error:
{"error":{"root_cause":[{"type":"null_pointer_exception","reason":null}],"type":"null_pointer_exception","reason":null},"status":500}
    at pl.allegro.tech.embeddedelasticsearch.ElasticRestClient.lambda$createIndex$1(ElasticRestClient.java:64)
    at pl.allegro.tech.embeddedelasticsearch.HttpClient.lambda$execute$1(HttpClient.java:24)
    at pl.allegro.tech.embeddedelasticsearch.HttpClient.execute(HttpClient.java:31)
    at pl.allegro.tech.embeddedelasticsearch.HttpClient.execute(HttpClient.java:23)
    at pl.allegro.tech.embeddedelasticsearch.ElasticRestClient.createIndex(ElasticRestClient.java:61)
    at java.util.HashMap$KeySet.forEach(HashMap.java:932)
    at pl.allegro.tech.embeddedelasticsearch.ElasticRestClient.createIndices(ElasticRestClient.java:52)
    at pl.allegro.tech.embeddedelasticsearch.EmbeddedElastic.createIndices(EmbeddedElastic.java:170)
    at pl.allegro.tech.embeddedelasticsearch.EmbeddedElastic.start(EmbeddedElastic.java:63)
    at SearchTest.initSearchInfra(SearchTest.java:101)
    at SearchTest.deploy(SearchTest.java:156)
    at SearchTest.lambda$before$5(SearchTest.java:215)
    at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:273)
    at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:745)
alinaalam-awin commented 5 years ago

Hey @sheldon-sminq !

I am getting the same error. Did you manage to solve it? If yes, then how?

Thanks,