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

resteasy reactive doesn't support wildcard type since quarkus 2.7.2 #24250

Closed
geniusit opened this issue Mar 10, 2022 · 4 comments · Fixed by #24262
Closed

resteasy reactive doesn't support wildcard type since quarkus 2.7.2 #24250

geniusit opened this issue Mar 10, 2022 · 4 comments · Fixed by #24262
Labels
area/rest env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@geniusit
Copy link

geniusit commented Mar 10, 2022

Describe the bug

Hi,

I have this method :

@GET
    @Produces(MediaType.TEXT_PLAIN)
    public Uni<RestResponse<?>> decodeKVB() {
        return connector.connectAsync() ;
    }

It works well until quarkus 2.7.1
Since I upgrade to quarkus 2.7.2 / 2.7.3 or 2.7.4 my application fails to start with the following stacktrace :

2022-03-10 18:33:03,434 ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error running Quarkus: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/java.lang.Class.newInstance(Class.java:584)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:120)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
        ... 6 more
Caused by: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
        ... 15 more
Caused by: java.lang.UnsupportedOperationException: Endpoint return type not supported yet: org.jboss.resteasy.reactive.common.util.types.WildcardTypeImpl@6c5e6ae4
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeResourceDeployment.getEffectiveReturnType(RuntimeResourceDeployment.java:647)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeResourceDeployment.getEffectiveReturnType(RuntimeResourceDeployment.java:643)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeResourceDeployment.getEffectiveReturnType(RuntimeResourceDeployment.java:637)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeResourceDeployment.buildResourceMethod(RuntimeResourceDeployment.java:361)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeDeploymentManager.deploy(RuntimeDeploymentManager.java:112)
        at io.quarkus.resteasy.reactive.server.runtime.ResteasyReactiveRecorder.createDeployment(ResteasyReactiveRecorder.java:121)
        at io.quarkus.deployment.steps.ResteasyReactiveProcessor$setupDeployment1557341086.deploy_0(Unknown Source)
        at io.quarkus.deployment.steps.ResteasyReactiveProcessor$setupDeployment1557341086.deploy(Unknown Source)
        ... 16 more


2022-03-10 18:33:04,243 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: java.lang.UnsupportedOperationException: Endpoint return type not supported yet: org.jboss.resteasy.reactive.common.util.types.WildcardTypeImpl@6c5e6ae4
        at io.quarkus.dev.appstate.ApplicationStateNotification.waitForApplicationStart(ApplicationStateNotification.java:51)
        at io.quarkus.runner.bootstrap.StartupActionImpl.runMainClass(StartupActionImpl.java:122)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:144)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:455)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:66)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:140)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:96)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:132)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: java.lang.UnsupportedOperationException: Endpoint return type not supported yet: org.jboss.resteasy.reactive.common.util.types.WildcardTypeImpl@6c5e6ae4
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeResourceDeployment.getEffectiveReturnType(RuntimeResourceDeployment.java:647)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeResourceDeployment.getEffectiveReturnType(RuntimeResourceDeployment.java:643)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeResourceDeployment.getEffectiveReturnType(RuntimeResourceDeployment.java:637)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeResourceDeployment.buildResourceMethod(RuntimeResourceDeployment.java:361)
        at org.jboss.resteasy.reactive.server.core.startup.RuntimeDeploymentManager.deploy(RuntimeDeploymentManager.java:112)
        at io.quarkus.resteasy.reactive.server.runtime.ResteasyReactiveRecorder.createDeployment(ResteasyReactiveRecorder.java:121)
        at io.quarkus.deployment.steps.ResteasyReactiveProcessor$setupDeployment1557341086.deploy_0(Unknown Source)
        at io.quarkus.deployment.steps.ResteasyReactiveProcessor$setupDeployment1557341086.deploy(Unknown Source)
        at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/java.lang.Class.newInstance(Class.java:584)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:120)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103)
        at java.base/java.lang.Thread.run(Thread.java:834)

Thank you for help

Bertrand

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

1 : create an app with the quarkus-resteasy-reactive-jackson dependency
2 : create a REST WS with a method that returns a Uni<RestResponse<?>>
3 : try to start the application

Output of uname -a or ver

No response

Output of java -version

openjdk version "11" 2018-09-25 OpenJDK Runtime Environment 18.9 (build 11+28) OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.4

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

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) Maven home: C:\dev\apache-maven-3.6.3\bin.. Java version: 11, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11 Default locale: fr_FR, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

No response

@geniusit geniusit added the kind/bug Something isn't working label Mar 10, 2022
@quarkus-bot quarkus-bot bot added area/rest env/windows Impacts Windows machines labels Mar 10, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 10, 2022

/cc @FroMage, @geoand, @stuartwdouglas

@geoand
Copy link
Contributor

geoand commented Mar 10, 2022

Good point...

We should probably disallow this completely.

WDYT @stuartwdouglas @FroMage ?

@stuartwdouglas
Copy link
Member

I think it should be treated the same as RestResponse (i.e. we just do full dynamic resolution).

@geoand
Copy link
Contributor

geoand commented Mar 11, 2022

#24262 does just that.

geoand added a commit that referenced this issue Mar 11, 2022
Support wildcards in generic return types of JAX-RS methods
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Mar 11, 2022
@gsmet gsmet modified the milestones: 2.8 - main, 2.7.5.Final Mar 14, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Mar 14, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants