# Unable to use rest-high-level client with GraalVM and Quarkus

**URL:** <https://discuss.elastic.co/t/unable-to-use-rest-high-level-client-with-graalvm-and-quarkus/239805>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [July 3, 2020, 12:34pm UTC](https://discuss.elastic.co/t/unable-to-use-rest-high-level-client-with-graalvm-and-quarkus/239805 "2020-07-03T12:34:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clementlesne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clementlesne/32/71582_2.png) [@clementlesne](https://discuss.elastic.co/u/clementlesne)\
**Post date:** [July 3, 2020, 12:34pm UTC](https://discuss.elastic.co/t/unable-to-use-rest-high-level-client-with-graalvm-and-quarkus/239805/1 "2020-07-03T12:34:14Z")

</div>

Hi,

I am unable to use the REST High Level Elasticsearch client on Quarkus with native image. The issue [has been referenced](https://github.com/oracle/graal/issues/460) into the GraalVM project.

**How to reproduce:**

1. Instantiate a Quarkus project
2. Add the rest-high-level client to your project & implement an action (i.e. GET a document)
3. Compile in native image
4. Execute & see the error

Versions:

- GraalMV `20.0-b02`
- Java `11.0.6+9`
- Quarkus `1.5.2.Final`
- Elasticsearch REST High Level client `7.8.0`
- RESTEasy `4.5.3.Final`

**Stacktraces:**

```auto
2020-07-03 12:03:10,368 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /xxx failed: org.jboss.resteasy.spi.UnhandledException: com.oracle.svm.core.jdk.UnsupportedFeatureError: ObjectOutputStream.writeObject()
	at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:106)
	at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:372)
	at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:216)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:515)
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:259)
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:160)
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:362)
	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:163)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:245)
	at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73)
	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:132)
	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.access$000(VertxRequestHandler.java:37)
	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:94)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
	at java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)
	at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:527)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)

Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: ObjectOutputStream.writeObject()
	at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:101)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:68)
	at org.apache.http.impl.client.BasicAuthCache.put(BasicAuthCache.java:107)
	at org.elasticsearch.client.RestClient.setNodes(RestClient.java:193)
	at org.elasticsearch.client.RestClient.<init>(RestClient.java:121)
	at org.elasticsearch.client.RestClientBuilder.build(RestClientBuilder.java:193)
	at org.elasticsearch.client.RestHighLevelClient.<init>(RestHighLevelClient.java:285)
	at org.elasticsearch.client.RestHighLevelClient.<init>(RestHighLevelClient.java:277)
	at org.enterpriseflowsrepository.api.traces.quarkus.clients.elasticsearch.HttpClient.getClient(HttpClient.java:477)
	at org.enterpriseflowsrepository.api.traces.quarkus.clients.elasticsearch.HttpClient.existsIndexAsync(HttpClient.java:232)
	at org.enterpriseflowsrepository.api.traces.quarkus.clients.elasticsearch.HttpClient_ClientProxy.existsIndexAsync(HttpClient_ClientProxy.zig:290)
	at org.enterpriseflowsrepository.api.traces.quarkus.repositories.TraceRepository.initialization(TraceRepository.java:74)
	at org.enterpriseflowsrepository.api.traces.quarkus.repositories.TraceRepository_Bean.create(TraceRepository_Bean.zig:325)
	at org.enterpriseflowsrepository.api.traces.quarkus.repositories.TraceRepository_Bean.create(TraceRepository_Bean.zig:341)
	at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:79)
	at io.quarkus.arc.impl.ComputingCache$CacheFunction.lambda$apply$0(ComputingCache.java:99)
	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
	at io.quarkus.arc.impl.ComputingCache.getValue(ComputingCache.java:41)
	at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:25)
	at org.enterpriseflowsrepository.api.traces.quarkus.repositories.TraceRepository_ClientProxy.arc$delegate(TraceRepository_ClientProxy.zig:92)
	at org.enterpriseflowsrepository.api.traces.quarkus.repositories.TraceRepository_ClientProxy.search(TraceRepository_ClientProxy.zig:186)
	at org.enterpriseflowsrepository.api.traces.quarkus.services.TracesService.getTraces(TracesService.java:76)
	at org.enterpriseflowsrepository.api.traces.quarkus.services.TracesService_Subclass.getTraces$superaccessor1(TracesService_Subclass.zig:277)
	at org.enterpriseflowsrepository.api.traces.quarkus.services.TracesService_Subclass$function$1.apply(TracesService_Subclass$function$1.zig:47)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
	at io.smallrye.faulttolerance.FaultToleranceInterceptor.lambda$syncFlow$5(FaultToleranceInterceptor.java:197)
	at io.smallrye.faulttolerance.core.InvocationContext.call(InvocationContext.java:20)
	at io.smallrye.faulttolerance.core.Invocation.apply(Invocation.java:24)
	at io.smallrye.faulttolerance.core.GeneralMetricsRecorder.apply(GeneralMetricsRecorder.java:17)
	at io.smallrye.faulttolerance.FaultToleranceInterceptor.syncFlow(FaultToleranceInterceptor.java:199)
	at io.smallrye.faulttolerance.FaultToleranceInterceptor.interceptCommand(FaultToleranceInterceptor.java:152)
	at io.smallrye.faulttolerance.FaultToleranceInterceptor_Bean.intercept(FaultToleranceInterceptor_Bean.zig:459)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
	at org.enterpriseflowsrepository.api.traces.quarkus.services.TracesService_Subclass.getTraces(TracesService_Subclass.zig:230)
	at org.enterpriseflowsrepository.api.traces.quarkus.services.TracesService_ClientProxy.getTraces(TracesService_ClientProxy.zig:200)
	at java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
	at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:621)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:487)
	at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:437)
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:362)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:439)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:400)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:374)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:67)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:488)
	... 19 more

```

---

<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:** [July 31, 2020, 12:34pm UTC](https://discuss.elastic.co/t/unable-to-use-rest-high-level-client-with-graalvm-and-quarkus/239805/2 "2020-07-31T12:34:17Z")

</div>

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