Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev mode fails to reload classes when using reactive rest client #341

Closed
snowdrop-bot opened this issue May 19, 2021 · 0 comments
Closed
Assignees
Labels
7 - Community development upstream/closed The issue has been closed in the upstream repository

Comments

@snowdrop-bot
Copy link
Collaborator

Describe the bug

We are using resteasy reactive and the reactive rest client in Quarkus 1.13.4.Final, gradle and Kotlin. Everytime the quarkus dev mode reloads the code, Quarkus is broken and we have to restart it.

We were able to break it down to a small reproducer. The problem seems to appear, when we have a POST resource that receives a DTO in the body and passes this dto to a rest client call that receives a generified response (best take a look at the ReactiveResource:getClient() method in the reproducer). When the service is freshly started gradlew quarkusDev, it all works fine. However, as soon as you change something and quarkus recompiles the code on the next call, it is broken.

We added a logging of the received object and there we get the following error:

2021-05-19 15:52:52,547 ERROR [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (vert.x-eventloop-thread-10) Request failed: java.lang.ClassCastException: class org.acme.dto.ApiResponse cannot be cast to class org.acme.dto.ApiResponse (org.acme.dto.ApiResponse is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @df5f5c0; org.acme.dto.ApiResponse is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @1091b449)
	at org.acme.ReactiveResource$getClient$1.apply(ReactiveResource.kt:18)
	at io.smallrye.context.impl.wrappers.SlowContextualFunction.apply(SlowContextualFunction.java:21)
...

When we do not add the logging, the response from the resource is just empty.

Please note: In the reproducer, we use the rest client to call the same quarkus service again. This is just to make the reproducer self contained. We also experienced this when calling another service.

Expected behavior

Quarkus Dev Mo

Actual behavior

The classes do not seem to be reloaded correctly.

To Reproduce

  1. Download reproducer and unzip 2021-05-19-restclient-dev-mode.zip
  2. In the project run ./gradlew quarkusDev
  3. Call the endpoint with
curl --location --request POST 'localhost:8080/client' \
--header 'Content-Type: application/json' \
--data-raw '{
	"name" : "Bernd"
}'
  1. Change anything in the code to cause a recompile on the next call
  2. Call the service again and observe the error in the log.

quarkusio#17359


$upstream:17359$

@snowdrop-bot snowdrop-bot added the upstream/closed The issue has been closed in the upstream repository label May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7 - Community development upstream/closed The issue has been closed in the upstream repository
Projects
None yet
Development

No branches or pull requests

2 participants