quarkusio / registry.quarkus.io

Quarkus Extension Registry application
https://registry.quarkus.io
Apache License 2.0
10 stars 11 forks source link

Native application fails with NoSuchMethodException when RestEasy Reactive is used #99

Closed gastaldi closed 2 years ago

gastaldi commented 2 years ago

After migrating to RestEasy Reactive (git revert 428f579b1e86abe4181240d200504d850740844e) the following error is present in the application logs when http://localhost:8080/client/platforms is hit:

java.lang.RuntimeException: java.lang.NoSuchMethodException: io.quarkus.registry.app.DatabaseRegistryClient.resolveCurrentPlatformsCatalog(java.lang.String)
    at org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo.getMethod(ResteasyReactiveResourceInfo.java:65)
    at org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo.getGenericReturnType(ResteasyReactiveResourceInfo.java:89)
    at org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext.getGenericReturnType(ResteasyReactiveRequestContext.java:588)
    at org.jboss.resteasy.reactive.server.core.ServerSerialisers.invokeWriter(ServerSerialisers.java:213)
    at org.jboss.resteasy.reactive.server.core.ServerSerialisers.invokeWriter(ServerSerialisers.java:178)
    at org.jboss.resteasy.reactive.server.core.serialization.FixedEntityWriterArray.write(FixedEntityWriterArray.java:28)
    at org.jboss.resteasy.reactive.server.handlers.ResponseWriterHandler.handle(ResponseWriterHandler.java:33)
    at org.jboss.resteasy.reactive.server.handlers.ResponseWriterHandler.handle(ResponseWriterHandler.java:15)
    at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
    at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:548)
    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)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:833)
    at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
    at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)
Caused by: java.lang.NoSuchMethodException: io.quarkus.registry.app.DatabaseRegistryClient.resolveCurrentPlatformsCatalog(java.lang.String)
    at java.lang.Class.getMethod(DynamicHub.java:2227)
    at org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo.getMethod(ResteasyReactiveResourceInfo.java:60)
    ... 17 more

How to reproduce:

geoand commented 2 years ago

https://github.com/quarkusio/quarkus/pull/25385 is the fix in RR for this.

Another way to get around it, would be to make your YamlProvider implement ServerMessageBodyWriter