# LambdaConversionException Invalid receiver type interface org.apache.http.Header -from RestHighLevelClient in Logstash Java plugin

**URL:** <https://discuss.elastic.co/t/lambdaconversionexception-invalid-receiver-type-interface-org-apache-http-header-from-resthighlevelclient-in-logstash-java-plugin/255393>\
**Category:** Elasticsearch\
**Created:** [November 14, 2020, 7:44am UTC](https://discuss.elastic.co/t/lambdaconversionexception-invalid-receiver-type-interface-org-apache-http-header-from-resthighlevelclient-in-logstash-java-plugin/255393 "2020-11-14T07:44:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellopcz](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hellopcz](https://discuss.elastic.co/u/hellopcz)\
**Post date:** [November 14, 2020, 7:44am UTC](https://discuss.elastic.co/t/lambdaconversionexception-invalid-receiver-type-interface-org-apache-http-header-from-resthighlevelclient-in-logstash-java-plugin/255393/1 "2020-11-14T07:44:07Z")

</div>

My RestHighLevelClient can run well in Win10 IDEA enviroment for testing, but when I "gradlew gem" the gem package, and run it in CentOS8 logstash-plugin enviroment(Logstash 7.9.0), there  
will be:

[2020-11-10T00:09:04,077][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
warning: thread "[main]\>worker1" terminated with exception (report\_on\_exception is true):  
java.lang.BootstrapMethodError: bootstrap method initialization exception  
at java.lang.invoke.BootstrapMethodInvoker.invoke(java/lang/invoke/BootstrapMethodInvoker.java:194)  
at java.lang.invoke.CallSite.makeSite(java/lang/invoke/CallSite.java:315)  
at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(java/lang/invoke/MethodHandleNatives.java:259)  
at java.lang.invoke.MethodHandleNatives.linkCallSite(java/lang/invoke/MethodHandleNatives.java:249)  
at org.elasticsearch.client.RestClient.convertResponse(org/elasticsearch/client/RestClient.java:288)  
at org.elasticsearch.client.RestClient.performRequest(org/elasticsearch/client/RestClient.java:272)  
at org.elasticsearch.client.RestClient.performRequest(org/elasticsearch/client/RestClient.java:246)  
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(org/elasticsearch/client/RestHighLevelClient.java:1613)  
at org.elasticsearch.client.RestHighLevelClient.performRequest(org/elasticsearch/client/RestHighLevelClient.java:1583)  
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(org/elasticsearch/client/RestHighLevelClient.java:1553)  
at org.elasticsearch.client.RestHighLevelClient.bulk(org/elasticsearch/client/RestHighLevelClient.java:533)  
at org.logstashplugins.OutputLogstashPlugin.bulkWriteES(org/logstashplugins/OutputLogstashPlugin.java:75)  
at org.logstashplugins.OutputLogstashPlugin.process(org/logstashplugins/OutputLogstashPlugin.java:617)  
at org.logstashplugins.JavaOutputExample.output(org/logstashplugins/JavaOutputExample.java:104)  
at org.logstash.config.ir.compiler.JavaOutputDelegatorExt.outputRubyEvents(org/logstash/config/ir/compiler/JavaOutputDelegatorExt.java:92)  
at org.logstash.config.ir.compiler.JavaOutputDelegatorExt.doOutput(org/logstash/config/ir/compiler/JavaOutputDelegatorExt.java:115)  
at org.logstash.config.ir.compiler.AbstractOutputDelegatorExt.multi\_receive(org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:121)  
at org.logstash.generated.CompiledDataset1.compute(org/logstash/generated/CompiledDataset1)  
at org.logstash.config.ir.CompiledPipeline$CompiledUnorderedExecution.compute(org/logstash/config/ir/CompiledPipeline.java:343)  
at org.logstash.config.ir.CompiledPipeline$CompiledUnorderedExecution.compute(org/logstash/config/ir/CompiledPipeline.java:333)  
at org.logstash.execution.WorkerLoop.run(org/logstash/execution/WorkerLoop.java:83)  
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(jdk/internal/reflect/NativeMethodAccessorImpl.java:62)  
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(jdk/internal/reflect/DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:564)  
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:426)  
at org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:293)  
at usr.local.logstash.logstash\_minus\_core.lib.logstash.java\_pipeline.start\_workers(/usr/local/logstash/logstash-core/lib/logstash/java\_pipeline.rb:293)  
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:318)  
at java.lang.Thread.run(java/lang/Thread.java:832)  
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:327)  
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:127)  
at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:315)  
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:259)  
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:249)  
at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:288)  
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:272)  
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:246)  
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1613)  
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1583)  
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1553)  
at org.elasticsearch.client.RestHighLevelClient.bulk(RestHighLevelClient.java:533)  
at org.logstashplugins.OutputLogstashPlugin.bulkWriteES(OutputLogstashPlugin.java:75)  
at org.logstashplugins.OutputLogstashPlugin.process(OutputLogstashPlugin.java:617)  
at org.logstashplugins.JavaOutputExample.output(JavaOutputExample.java:104)  
at org.logstash.config.ir.compiler.JavaOutputDelegatorExt.outputRubyEvents(JavaOutputDelegatorExt.java:92)  
at org.logstash.config.ir.compiler.JavaOutputDelegatorExt.doOutput(JavaOutputDelegatorExt.java:115)  
at org.logstash.config.ir.compiler.AbstractOutputDelegatorExt.multiReceive(AbstractOutputDelegatorExt.java:121)  
at org.logstash.generated.CompiledDataset1.compute(Unknown Source)  
at org.logstash.config.ir.CompiledPipeline$CompiledUnorderedExecution.compute(CompiledPipeline.java:343)  
at org.logstash.config.ir.CompiledPipeline$CompiledUnorderedExecution.compute(CompiledPipeline.java:333)  
at org.logstash.execution.WorkerLoop.run(WorkerLoop.java:83)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

The CentOS 8 jvm enviroment version is jdk 11, the same as the IDEA win10 enviroment. There is no http httpcore.jar class path issue. httpclient is in the httpasyncclient-4.1.4.jar' related version like below:

compile fileTree(dir: 'D:\project\logELK\logstash-output-java\_output\_example\locallib\httpclient', include: 'httpasyncclient-4.1.4.jar')  
compile fileTree(dir: 'D:\project\logELK\logstash-output-java\_output\_example\locallib\httpclient', include: 'httpclient-4.5.6.jar')  
compile fileTree(dir: 'D:\project\logELK\logstash-output-java\_output\_example\locallib\httpclient', include: 'httpcore-4.4.10.jar')  
compile fileTree(dir: 'D:\project\logELK\logstash-output-java\_output\_example\locallib\httpclient', include: 'httpcore-nio-4.4.10.jar')

I've searched the logstash project, there is no httpclient reference or its related dependencies. Logstash uses jruby code to do http thing by its own http\_client.rb.  
The deprecated Jest Client can be used in CentOS 8 logstash Java plugin enviroment, but I am still struggling to find the Bulk Json insertion solution in Jest Client.  
Could some expert give me some advices? Thanks!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 14, 2020, 12:53pm UTC](https://discuss.elastic.co/t/lambdaconversionexception-invalid-receiver-type-interface-org-apache-http-header-from-resthighlevelclient-in-logstash-java-plugin/255393/2 "2020-11-14T12:53:49Z")

</div>

Welcome!

What exactly are you doing and why?

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

---

<div class="post-metadata">

**Author:** ![hellopcz](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hellopcz](https://discuss.elastic.co/u/hellopcz)\
**Post date:** [November 16, 2020, 7:29am UTC](https://discuss.elastic.co/t/lambdaconversionexception-invalid-receiver-type-interface-org-apache-http-header-from-resthighlevelclient-in-logstash-java-plugin/255393/3 "2020-11-16T07:29:48Z")

</div>

I am using the \</\> button for just serveral sentences' formatting but failed 🤣 Or I have to use markdown editor?

---

<div class="post-metadata">

**Author:** ![hellopcz](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hellopcz](https://discuss.elastic.co/u/hellopcz)\
**Post date:** [November 16, 2020, 7:43am UTC](https://discuss.elastic.co/t/lambdaconversionexception-invalid-receiver-type-interface-org-apache-http-header-from-resthighlevelclient-in-logstash-java-plugin/255393/4 "2020-11-16T07:43:59Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/8/4/8488c7f702caaa18d505fea69769515188d0f239.png)

I've post the my question by markdown format but also failed. Does the notice above tell me to use ' key replace the return key?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 16, 2020, 9:17am UTC](https://discuss.elastic.co/t/lambdaconversionexception-invalid-receiver-type-interface-org-apache-http-header-from-resthighlevelclient-in-logstash-java-plugin/255393/5 "2020-11-16T09:17:55Z")

</div>

You can copy paste the exact characters to use. Note that it's not `'`.

````
```
CODE
```
````

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 14, 2020, 9:18am UTC](https://discuss.elastic.co/t/lambdaconversionexception-invalid-receiver-type-interface-org-apache-http-header-from-resthighlevelclient-in-logstash-java-plugin/255393/6 "2020-12-14T09:18:04Z")

</div>

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