RestClient always gives "I/O reactor status: STOPPED"

I am using ES 5.6.3. In my program I am using the rest-client 5.6.3 jar files. This is how I am constructing my RestClient:

RestClient restClient = RestClient.Builder(new HttpHost("localhost", 9200, "http")).build();

I have tried using the restClient.performRequest() method attempting to do various things but it always throws "java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED".

My external ES is running on the same host as the test, which I am running from IntelliJ. I am tailing the ES log file and don't see any activity. I can do a curl command to ES in a terminal and that works fine.

Any ideas?

Hi Kevin,
that sounds weird, looks like the underlying http client is stopped, but that gets started by RestClientBuilder when calling build and is stopped internally when the client gets closed. Maybe silly question, but is there a possibility that the client gets closed before you do the performRequest? Or do you see any errors in the log when creating the client? How do you run your client code?

Cheers
Luca

Figured out the issue. I had not added log4j2 to my pom. Once I did I realized that the actual problem was a jar hell issue.

1 Like

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