quarkus: ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-0) HTTP Request to : java.lang.RuntimeException: java.lang.NoSuchMethodException

Describe the bug

Code like this, when i start the application with quarkus:dev everything is fine:

@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("auth")
public class AuthResource {
  @Inject UserService userService;

  @POST
  @Path("login/js/code")
  public AuthUser login(UserDto entity) {
    return userService.getOrRegByOpenId(entity);
  }
}

But when I deploy on cloud inside a docker container (quarkus is builded native) I got:

2022-09-24 13:23:15,247 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-0) HTTP Request to /auth/login/js/code failed, error id: 5cd687e7-a7c9-4ab1-871e-996447b851fd-2: java.lang.RuntimeException: java.lang.NoSuchMethodException: com.seepine.koi.resource.AuthResource.login(com.seepine.koi.entity.dto.UserDto)
	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 javax.ws.rs.container.ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_ClientProxy.getResourceMethod(Unknown Source)
	at com.seepine.secret.quarkus.runtime.filter.PermissionFilter.filter(PermissionFilter.java:25)
	at org.jboss.resteasy.reactive.server.handlers.ResourceRequestFilterHandler.handle(ResourceRequestFilterHandler.java:47)
	at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:98)
	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:140)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:557)
	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:600)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
Caused by: java.lang.NoSuchMethodException: com.seepine.koi.resource.AuthResource.login(com.seepine.koi.entity.dto.UserDto)
	at java.lang.Class.getMethod(DynamicHub.java:1152)
	at org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo.getMethod(ResteasyReactiveResourceInfo.java:65)

	... 15 more

Output of java -version

java11

GraalVM version (if different from Java)

build with quay.io/quarkus/ubi-quarkus-native-image:21.3-java11

Quarkus version or git rev

2.12.1.Final

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

gradle 7.5

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (14 by maintainers)

Commits related to this issue

Most upvoted comments

@itzsuman You can find it SecretReflectionConfig.java, but i am not sure if it can solve your problem.

it work with @RegisterForReflection

I see, then yeah, in that case you do need the method. The only workaround in this case it to annotate the JAX-RS classes with @RegisterForReflection

I will try and give feedback if it works

i will organize a reproducible demo later