Java Client not working for OpenSearch document insert

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): Opensearch

OpenSearchClientExample.java when run with mentioned dependencies throws java.lang.invoke.LambdaConversionException

 

Configuration:
org.opensearch.client
opensearch-rest-client
1.2.4


org.opensearch.client
opensearch-java
0.1.0

Relevant Logs or Screenshots:

Exception in thread “main” java.lang.BootstrapMethodError: bootstrap method initialization exception
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:194)
at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:307)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:258)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:248)
at org.opensearch.client.RestClient.convertResponse(RestClient.java:330)
at org.opensearch.client.RestClient.performRequest(RestClient.java:314)
at org.opensearch.client.RestClient.performRequest(RestClient.java:289)
at org.opensearch.client.base.RestClientTransport.performRequest(RestClientTransport.java:77)
at org.opensearch.client.opensearch.OpenSearchClient.index(OpenSearchClient.java:641)
at com.dmat.lambda.OpenSearchClientExample.main(OpenSearchClientExample.java:60)
Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair
at java.base/java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:254)
at java.base/java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:328)
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:127)
… 9 more