question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

class io.quarkus.restclient.runtime.RestClientRecorder$1 cannot be cast to class org.jboss.resteasy.reactive.common.jaxrs.RuntimeDelegateImpl

See original GitHub issue

Describe the bug

I am upgrading my quarkus-bom version from the 2.12.2.Final to the most recent one. I am getting the following error when making a call to my REST endpoints or running my integration tests:

2022-11-23 10:39:36,457 ERROR [com.ctw.lm.dom.exc.map.RuntimeResponseMapper] (executor-thread-0) class io.quarkus.restclient.runtime.RestClientRecorder$1 cannot be cast to class org.jboss.resteasy.reactive.common.jaxrs.RuntimeDelegateImpl (io.quarkus.restclient.runtime.RestClientRecorder$1 and org.jboss.resteasy.reactive.common.jaxrs.RuntimeDelegateImpl are in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @2abf4075): java.lang.ClassCastException: class io.quarkus.restclient.runtime.RestClientRecorder$1 cannot be cast to class org.jboss.resteasy.reactive.common.jaxrs.RuntimeDelegateImpl (io.quarkus.restclient.runtime.RestClientRecorder$1 and org.jboss.resteasy.reactive.common.jaxrs.RuntimeDelegateImpl are in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @2abf4075) at org.jboss.resteasy.reactive.RestResponse$ResponseBuilder.newInstance(RestResponse.java:850) at org.jboss.resteasy.reactive.RestResponse$ResponseBuilder.create(RestResponse.java:1243) at org.jboss.resteasy.reactive.RestResponse$ResponseBuilder.create(RestResponse.java:1265) at org.jboss.resteasy.reactive.RestResponse$ResponseBuilder.ok(RestResponse.java:1311) at com.ctw.lm.api.impl.AnalyticsApiImpl.getIndividualBudgetPaginatedBetweenTwoDates(AnalyticsApiImpl.java:143) at com.ctw.lm.api.impl.AnalyticsApiImpl_Subclass.getIndividualBudgetPaginatedBetweenTwoDates$$superforward1(Unknown Source) at com.ctw.lm.api.impl.AnalyticsApiImpl_Subclass$$function$$1.apply(Unknown Source) at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54) at io.quarkus.hibernate.validator.runtime.interceptor.AbstractMethodValidationInterceptor.validateMethodInvocation(AbstractMethodValidationInterceptor.java:71) at io.quarkus.hibernate.validator.runtime.jaxrs.ResteasyReactiveEndPointValidationInterceptor.validateMethodInvocation(ResteasyReactiveEndPointValidationInterceptor.java:21) at io.quarkus.hibernate.validator.runtime.jaxrs.ResteasyReactiveEndPointValidationInterceptor_Bean.intercept(Unknown Source) at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42) at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:50) at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62) at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49) at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source) at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42) at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41) at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:33) at com.ctw.lm.api.impl.AnalyticsApiImpl_Subclass.getIndividualBudgetPaginatedBetweenTwoDates(Unknown Source) at com.ctw.lm.api.impl.AnalyticsApiImpl_ClientProxy.getIndividualBudgetPaginatedBetweenTwoDates(Unknown Source) at com.ctw.lm.api.AnalyticsApi$quarkusrestinvoker$getIndividualBudgetPaginatedBetweenTwoDates_ef7166c911640efd60ac16d68b3eb8a24a5c85d8.invoke(Unknown Source) at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29) at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:115) at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:142) at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:564) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478) at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29) at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)

I don´t know if this helps but I started incrementing the version one by one and I noticed this started happening on the 2.13.1.Final version.

Expected behavior

I should be able to call my REST endpoints and receive a response. I should be able to run my integration tests successfully.

Actual behavior

It is throwing the error: RestClientRecorder$1 cannot be cast to class org.jboss.resteasy.reactive.common.jaxrs.RuntimeDelegateImpl when making calls to the REST Client and when running integration tests.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
geoandcommented, Nov 23, 2022

The fact that it worked before was an accident

0reactions
HugoVinhal98commented, Nov 23, 2022

But why is the REST Client dependency (which is responsible to communicate with external services) is related to the REST client of the actual project?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing REST Services with RESTEasy Reactive - Quarkus
RESTEasy Reactive is a new JAX-RS implementation written from the ground up to work on our common Vert.x layer and is thus fully...
Read more >
Resteasy Reactive : issue with RestClient #13999 - GitHub
UriBuilderImpl cannot be cast to class org.jboss.resteasy.spi.ResteasyUriBuilder (org.jboss.resteasy.reactive.common.jaxrs.
Read more >
Error using RestResponse from RestEasy Reactive library
I just solved the problem... It was the order of dependecies. I switched quarkus-resteasy-reactive to the top and it is working now.
Read more >
REST API error modeling with Quarkus 2.0 - Red Hat Developer
Dive into REST API error handling with Quarkus. ... Response; import org.junit.jupiter.api. ... org.jboss.resteasy.reactive.common.core.
Read more >
quarkus-bot[bot] - Developer Q&A Platform - PullAnswer
class io.quarkus.restclient.runtime.RestClientRecorder$1 cannot be cast to class org.jboss.resteasy.reactive.common.jaxrs.RuntimeDelegateImpl.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found