Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException while getting RestHighLevelClient #1

Open
sunnybatabyal opened this issue Aug 29, 2022 · 1 comment

Comments

@sunnybatabyal
Copy link

Below is my setup method

@Before
    public void setUp() {
        HttpHost host = new HttpHost("127.0.0.1", 9200);
        RestClientBuilder restClientBuilder = RestClient.builder(host);
        hClient = new RestHighLevelClient(restClientBuilder);
        lClient = hClient.getLowLevelClient();
    }

Which is giving me below error in line new RestHighLevelClient(restClientBuilder);

java.lang.IllegalArgumentException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.github.smitajit.elasticsearch.rest.mock.util.Utils.getProxiedClient(Utils.java:77)
	at org.elasticsearch.client.RestClientBuilder.build(RestClientBuilder.java)
	at org.elasticsearch.client.RestHighLevelClient.<init>(RestHighLevelClient.java:301)
	at org.elasticsearch.client.RestHighLevelClient.<init>(RestHighLevelClient.java:293)
	at search.repository.SSMockRunnerTest.setUp(SSMockRunnerTest.java:30)
@sunnybatabyal
Copy link
Author

The above error is with ES REST Client 7.17 but the codebase is using ES rest client 6.2.3 which caused the error. Needs dependency update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant