RestEasy reactive with smallrye metrics throws NoSuchMethodException

22 views
Skip to first unread message

swidersk...@gmail.com

unread,
Sep 17, 2021, 5:51:52 AM9/17/21
to Quarkus Development mailing list
Hello,

I am running into an issue in native mode with rest easy reactive and smallrye metrics. Here is the stack trace logged when accessing the endpoint

2021-09-17 09:38:08,156 ERROR [io.aut.eng.ser.exc.UnknownExceptionMapper] (executor-thread-0) Unexpected error processing request: java.lang.RuntimeException: java.lang.NoSuchMethodException: org.acme.ScriptsResource.create_scripts(javax.ws.rs.core.HttpHeaders, java.lang.String, java.lang.String, java.util.List, org.acme.ScriptsModelInput)
at org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo.getMethod(ResteasyReactiveResourceInfo.java:70)
at org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo.getResourceMethod(ResteasyReactiveResourceInfo.java:101)
at org.jboss.resteasy.reactive.server.injection.ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_ClientProxy.getResourceMethod(ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_ClientProxy.zig:89)
at io.smallrye.metrics.jaxrs.JaxRsMetricsFilter.filter(JaxRsMetricsFilter.java:57)
at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:40)
at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:8)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543)
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:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:567)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
Caused by: java.lang.NoSuchMethodException: org.acme.ScriptsResource.create_scripts(javax.ws.rs.core.HttpHeaders, java.lang.String, java.lang.String, java.util.List, org.acme.ScriptsModelInput)
at java.lang.Class.getMethod(DynamicHub.java:1120)
at org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo.getMethod(ResteasyReactiveResourceInfo.java:65)
... 15 more

Unfortunately I cannot reproduce it with simple example so would like to ask for some hints how to figure it out what might be causing it.

The method it complains about is actually defined in the endpoint

@POST()
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response create_scripts(@Context HttpHeaders httpHeaders, @QueryParam("businessKey") String businessKey, @QueryParam("user") final String user, @QueryParam("group") final List<String> groups, ScriptsModelInput resource) {
...
}

It only happens with native mode (jvm, dev works fine).

Using 2.2.1 of Quarkus and building native image in docker based on quarkus native image images which uses GraalVM 21.2.0 Java 11 CE (Java Version 11.0.12+6-jvmci-21.2-b08)

Maciej

Georgios Andrianakis

unread,
Sep 17, 2021, 7:35:05 AM9/17/21
to swidersk...@gmail.com, Quarkus Development mailing list
Hi,

A temporary workaround would be to use @RegisterForReflection on ScriptsResource.

But this is an issue we need to fix, can you please open a github issue?

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/A1E3BF4D-ED44-499A-80C3-816577C3464C%40gmail.com.

swidersk...@gmail.com

unread,
Sep 17, 2021, 7:36:30 AM9/17/21
to Georgios Andrianakis, Quarkus Development mailing list
Ha what I timing Georgios! I just finished the native build and hit test when your email came so I confirm it works :)

On my way to file the issue

Thanks
Maciej

swidersk...@gmail.com

unread,
Sep 17, 2021, 7:42:52 AM9/17/21
to Georgios Andrianakis, Quarkus Development mailing list
On 17 Sep 2021, at 13:34, Georgios Andrianakis <gand...@redhat.com> wrote:

Georgios Andrianakis

unread,
Sep 17, 2021, 7:44:15 AM9/17/21
to swidersk...@gmail.com, Quarkus Development mailing list
Great, thanks!
Reply all
Reply to author
Forward
0 new messages