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

Hot reload fails when using BeanParam #45625

Open
FreifeldRoyi opened this issue Jan 15, 2025 · 3 comments
Open

Hot reload fails when using BeanParam #45625

FreifeldRoyi opened this issue Jan 15, 2025 · 3 comments
Labels
area/rest kind/bug Something isn't working

Comments

@FreifeldRoyi
Copy link

Describe the bug

Every usage of BeanParam causes hot reload to fail and requires manual reload of the app.
I'm running graalvm 23

Expected behavior

When using BeanParam for the first time, everything works as expected including after a small change in the code when the hot reload kicks in.

Actual behavior

When I change anything in the code while the app is running, the hot reload fails on the next request to the service with the following (shortened) exception:

loader constraint violation: when resolving method 'com.freifeld.SimpleBeanParam com.freifeld.SimpleBeanParam.__quarkus_rest_inject(org.jboss.resteasy.reactive.server.injection.ResteasyReactiveInjectionContext)' the class loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @52af26ee of the current class, org/jboss/resteasy/reactive/server/core/parameters/RecordBeanParamExtractor, and the class loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @e30e4ad for the method's defining class, com/freifeld/SimpleBeanParam, have different Class objects for the type com/freifeld/SimpleBeanParam used in the signature (org.jboss.resteasy.reactive.server.core.parameters.RecordBeanParamExtractor is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @52af26ee, parent loader 'app'; com.freifeld.SimpleBeanParam is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @e30e4ad, parent loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @52af26ee)

To make it work again, it requires a manual restart.

How to Reproduce?

https://github.com/FreifeldRoyi/bean-param-issue

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.17.6

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

No response

Additional information

No response

@FreifeldRoyi FreifeldRoyi added the kind/bug Something isn't working label Jan 15, 2025
Copy link

quarkus-bot bot commented Jan 16, 2025

/cc @FroMage (rest), @stuartwdouglas (rest)

@geoand
Copy link
Contributor

geoand commented Jan 16, 2025

@FroMage sounds like one for you

@andyhoffmanlifelens
Copy link

I am experiencing this same issue with a record class annotated with @BeanParam in the @post REST method. Initial startup with "quarkus dev" allows the REST call to succeed when called multiple times, but a code change triggering dynamic reload of running system results in an invocation target exception. Each field specified in the record parameters is annotated with @restform.

Some relevant parts of stack trace:

java.lang.RuntimeException: Failed to find target generated factory method on record @BeanParam type
at org.jboss.resteasy.reactive.server.core.parameters.RecordBeanParamExtractor.(RecordBeanParamExtractor.java:19)
....
Caused by: java.lang.IllegalAccessException: no such method: com.lifelenstech.bundlesubmission.rest.BundleForm.__quarkus_rest_inject(ResteasyReactiveInjectionContext)BundleForm/invokeStatic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants