Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-4477

RestEasy reactive client @Retry fails in native mode

XMLWordPrintable

    • Red Hat build of Quarkus

      A RestEasy reactive client marked with @Retry works correctly in java mode (i.e. when there are failures, the client makes multiple calls according to the configured fault-tolerance policies).

      The same code fails when running in native mode per below:

      DEBUG [com.example.AbstractResteasyReactiveContext] (executor-thread-2) Restarting handler chain for exception exception: jakarta.ws.rs.ProcessingException: RequestScoped context was not active when trying to obtain a bean instance for a client proxy of CLASS bean [class=com.example.RequestIdManagerImpl, id=930399259eca7cd1255a5f248739c56793fa5533]
              - you can activate the request context for a specific method using the @ActivateRequestContext interceptor binding
              at org.jboss.resteasy.reactive.client.handlers.ClientRequestFilterRestHandler.handle(ClientRequestFilterRestHandler.java:28)
              at org.jboss.resteasy.reactive.client.handlers.ClientRequestFilterRestHandler.handle(ClientRequestFilterRestHandler.java:10)
              at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.invokeHandler(AbstractResteasyReactiveContext.java:229)
              at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)
              at org.jboss.resteasy.reactive.client.impl.AsyncInvokerImpl.performRequestInternal(AsyncInvokerImpl.java:285)
              at org.jboss.resteasy.reactive.client.impl.AsyncInvokerImpl.performRequestInternal(AsyncInvokerImpl.java:275)
              at org.jboss.resteasy.reactive.client.impl.AsyncInvokerImpl.method(AsyncInvokerImpl.java:215)
              at org.jboss.resteasy.reactive.client.impl.AsyncInvokerImpl.method(AsyncInvokerImpl.java:29)
              at com.example.ClientResource$$QuarkusRestClientInterface.getItemsAsync(Unknown Source)
              at com.example.ClientResource$$CDIWrapper.getItemsAsync(Unknown Source)
              at com.example.ClientResource$$CDIWrapper_Subclass.getItemsAsync$$superforward(Unknown Source)
              at com.example.ClientResource$$CDIWrapper_Subclass$$function$$1.apply(Unknown Source)
              at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:73)
              at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:62)
              at io.smallrye.faulttolerance.internal.InterceptionInvoker.proceed(InterceptionInvoker.java:38)
              at io.smallrye.faulttolerance.core.invocation.CompletionStageSupport.toCompletionStage(CompletionStageSupport.java:25)
              at io.smallrye.faulttolerance.FaultToleranceInterceptor.lambda$asyncFlow$1(FaultToleranceInterceptor.java:237)
              at io.smallrye.faulttolerance.core.InvocationContext.call(InvocationContext.java:20)
              at io.smallrye.faulttolerance.core.Invocation.apply(Invocation.java:29)
              at io.smallrye.faulttolerance.internal.RequestScopeActivator.apply(RequestScopeActivator.java:27)
              at io.smallrye.faulttolerance.core.async.CompletionStageExecution.lambda$doApply$0(CompletionStageExecution.java:46)
              at io.smallrye.faulttolerance.core.util.DirectExecutor.execute(DirectExecutor.java:17)
              at io.smallrye.faulttolerance.core.async.CompletionStageExecution.doApply(CompletionStageExecution.java:44)
              at io.smallrye.faulttolerance.core.async.CompletionStageExecution.apply(CompletionStageExecution.java:34)
              at io.smallrye.faulttolerance.core.async.CompletionStageExecution.apply(CompletionStageExecution.java:21)
              at io.smallrye.faulttolerance.core.retry.CompletionStageRetry.afterDelay(CompletionStageRetry.java:88)
              at io.smallrye.faulttolerance.core.retry.CompletionStageRetry.lambda$doRetry$0(CompletionStageRetry.java:60)
              at io.smallrye.faulttolerance.core.timer.ThreadTimer.lambda$new$1(ThreadTimer.java:90)
              at io.smallrye.context.impl.wrappers.SlowContextualRunnable.run(SlowContextualRunnable.java:19)
              at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:581)
              at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1512)
              at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
              at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
              at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
              at java.base@17.0.10/java.lang.Thread.run(Thread.java:840)
              at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:807)
              at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:210)
      Caused by: jakarta.enterprise.context.ContextNotActiveException: RequestScoped context was not active when trying to obtain a bean instance for a client proxy of CLASS bean [class=com.example.RequestIdManagerImpl, id=930399259eca7cd1255a5f248739c56793fa5533]
              - you can activate the request context for a specific method using the @ActivateRequestContext interceptor binding
              at io.quarkus.arc.impl.ClientProxies.getDelegate(ClientProxies.java:55)
              at com.example.RequestIdManagerImpl_ClientProxy.arc$delegate(Unknown Source)
              at com.example.RequestIdManagerImpl_ClientProxy.currentRequestId(Unknown Source)
              at com.example.RequestIdClientRequestFilter.filter(RequestIdClientRequestFilter.java:23)
              at com.example.RequestIdClientRequestFilter_ClientProxy.filter(Unknown Source)
              at org.jboss.resteasy.reactive.client.handlers.ClientRequestFilterRestHandler.handle(ClientRequestFilterRestHandler.java:25)
              ... 37 more

              lthon@redhat.com Ladislav Thon
              rhn-support-mmillson Michael Millson
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: