# BulkProcessor creation using RestHighLevelClient compilation error on ES5.6

**URL:** <https://discuss.elastic.co/t/bulkprocessor-creation-using-resthighlevelclient-compilation-error-on-es5-6/140573>\
**Category:** Elasticsearch\
**Created:** [July 18, 2018, 2:07pm UTC](https://discuss.elastic.co/t/bulkprocessor-creation-using-resthighlevelclient-compilation-error-on-es5-6/140573 "2018-07-18T14:07:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Rappahannock](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@Rappahannock](https://discuss.elastic.co/u/Rappahannock)\
**Post date:** [July 18, 2018, 2:12pm UTC](https://discuss.elastic.co/t/bulkprocessor-creation-using-resthighlevelclient-compilation-error-on-es5-6/140573/2 "2018-07-18T14:12:19Z")

</div>

Similar problem has been discussed in the following topics:

> [@Headache with RestHighLevelClient and bulkprocessor](https://discuss.elastic.co/t/headache-with-resthighlevelclient-and-bulkprocessor/106072):
>
> BulkProcessor.Builder builder = BulkProcessor.builder(client::bulkAsync, new BulkProcessorListener()); this line is complaining The target type of this expression must be a functional interface the error is this part: builder(client::bulkAsync, any idea? please help import org.elasticsearch.client.RestHighLevelClient; RestHighLevelClient client; environment: java 8, eclipse

> [@\[BUG\] You can use BulkProcessor with high-level client in 5.6 version](https://discuss.elastic.co/t/bug-you-can-use-bulkprocessor-with-high-level-client-in-5-6-version/123602):
>
> Hi team, Thanks in advance I try to create a BulkProcessor like [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/5.6/java-rest-high-document-bulk.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/5.6/java-rest-high-document-bulk.html) with the high-level client in the version 5.6 but I get this compilation error at this point: ... RestHighLevelClient rHLClient ... BulkProcessor bulkProcessor = BulkProcessor.builder(rHLClient::bulkAsync, listener,threadPool).build(); "Client is not a functional interface" If there is a better way to use that, please advis…

But I don't find there how to solve my problem.

This comment suggests that it's a bug in Eclipse IDE: [[BUG] You can use BulkProcessor with high-level client in 5.6 version - #9 by juanaramis](https://discuss.elastic.co/t/bug-you-can-use-bulkprocessor-with-high-level-client-in-5-6-version/123602/9)

But I compile in another IDE, also I compile from command line using maven 3.0.4.

Here is an extract from my maven compilation log:

```auto
Apache Maven 3.0.4 (r1232337; 2012-01-17 12:44:56+0400)
Maven home: F:\1_Tools\apache-maven-3.0.4
Java version: 1.8.0_77, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_77\jre
Default locale: en_US, platform encoding: Cp1251
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from F:\1_Tools\apache-maven-3.0.4\conf\settings.xml
[DEBUG] Reading user settings from C:\...\.m2\settings.xml
[DEBUG] Using local repository at C:\m2
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\m2
...
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /F:/GIT/0_Examples/test-bulkprocessor/src/main/java/com/rappahannock/elasticsearch/ESConfiguration.java: incompatible types: org.elasticsearch.client.Client is not a functional interface
    multiple non-overriding abstract methods found in interface org.elasticsearch.client.Client
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.067s
[INFO] Finished at: Wed Jul 18 17:28:21 GET 2018
[INFO] Final Memory: 26M/306M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project test-bulkprocessor: Compilation failure
[ERROR] /F:/GIT/0_Examples/test-bulkprocessor/src/main/java/com/rappahannock/elasticsearch/ESConfiguration.java: incompatible types: org.elasticsearch.client.Client is not a functional interface
[ERROR] multiple non-overriding abstract methods found in interface org.elasticsearch.client.Client
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project test-bulkprocessor: Compilation failure
/F:/GIT/0_Examples/test-bulkprocessor/src/main/java/com/rappahannock/elasticsearch/ESConfiguration.java: incompatible types: org.elasticsearch.client.Client is not a functional interface
    multiple non-overriding abstract methods found in interface org.elasticsearch.client.Client

	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
/F:/GIT/0_Examples/test-bulkprocessor/src/main/java/com/rappahannock/elasticsearch/ESConfiguration.java: incompatible types: org.elasticsearch.client.Client is not a functional interface
    multiple non-overriding abstract methods found in interface org.elasticsearch.client.Client

	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
	at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	... 19 more

```

---

_[View the full topic](https://discuss.elastic.co/t/bulkprocessor-creation-using-resthighlevelclient-compilation-error-on-es5-6/140573)._
