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

2.0.0.Alpha2: Failed to generate client for Mp rest client interface #17089

Closed
hantsy opened this issue May 8, 2021 · 1 comment · Fixed by #17095
Closed

2.0.0.Alpha2: Failed to generate client for Mp rest client interface #17089

hantsy opened this issue May 8, 2021 · 1 comment · Fixed by #17095
Assignees
Labels
area/rest-client kind/bug Something isn't working
Milestone

Comments

@hantsy
Copy link
Contributor

hantsy commented May 8, 2021

The codes are similar to #17084, I upgrade to Quarkus 2.0.0.alpha2 and got the following exception.

  • Quarkus 2.0.0.Alpha2
  • RestClient Reactive/Resteasy Reactive
2021-05-08 13:16:06,251 ERROR [org.jbo.res.rea.ser.cor.ExceptionMapping] (vert.x-eventloop-thread-3) Request failed : java.lang.RuntimeException: Error injecting com.example.demo.PostR
esourceClient com.example.demo.PostController.client
        at com.example.demo.PostController_Bean.create(PostController_Bean.zig:225)
        at com.example.demo.PostController_Bean.create(PostController_Bean.zig:248)
        at io.quarkus.arc.impl.RequestContext.getIfActive(RequestContext.java:68)
        at io.quarkus.arc.impl.ClientProxies.getDelegate(ClientProxies.java:33)
        at com.example.demo.PostController_ClientProxy.arc$delegate(PostController_ClientProxy.zig:42)
        at com.example.demo.PostController_ClientProxy.getAllPosts(PostController_ClientProxy.zig:133)
        at com.example.demo.PostController$quarkusrestinvoker$getAllPosts_e86e499f776b53a0f1950570a1bd4434ea61b09b.invoke(PostController$quarkusrestinvoker$getAllPosts_e86e499f776b53a0
f1950570a1bd4434ea61b09b.zig:55)
        at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
        at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:7)
        at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:132)
        at org.jboss.resteasy.reactive.server.handlers.RestInitialHandler.beginProcessing(RestInitialHandler.java:47)
        at org.jboss.resteasy.reactive.server.vertx.ResteasyReactiveVertxHandler.handle(ResteasyReactiveVertxHandler.java:17)
        at org.jboss.resteasy.reactive.server.vertx.ResteasyReactiveVertxHandler.handle(ResteasyReactiveVertxHandler.java:7)
        at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1129)
        at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:151)
        at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133)
        at io.quarkus.vertx.http.runtime.StaticResourcesRecorder.lambda$start$1(StaticResourcesRecorder.java:65)
        at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1129)
        at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:114)
        at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133)
        at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$sendStatic$1(StaticHandlerImpl.java:200)
        at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:124)
        at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: org.eclipse.microprofile.rest.client.RestClientDefinitionException: org.jboss.resteasy.reactive.client.api.InvalidRestClientDefinitionException: Failed to generate client fo
r class interface com.example.demo.PostResourceClient : Cannot invoke "org.jboss.jandex.ClassInfo.interfaceNames()" because the return value of "org.jboss.jandex.IndexView.getClassByNa
me(org.jboss.jandex.DotName)" is null
        at io.quarkus.rest.client.reactive.runtime.RestClientBuilderImpl.build(RestClientBuilderImpl.java:275)
        at io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilder.build(RestClientCDIDelegateBuilder.java:71)
        at io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilder.createDelegate(RestClientCDIDelegateBuilder.java:53)
        at io.quarkus.rest.client.reactive.runtime.RestClientReactiveCDIWrapperBase.<init>(RestClientReactiveCDIWrapperBase.java:16)
        at com.example.demo.PostResourceClient$$CDIWrapper.<init>(PostResourceClient$$CDIWrapper.zig:21)
        at com.example.demo.PostResourceClient$$CDIWrapper_Subclass.<init>(PostResourceClient$$CDIWrapper_Subclass.zig:40)
        at com.example.demo.PostResourceClient$$CDIWrapper_Bean.create(PostResourceClient$$CDIWrapper_Bean.zig:194)
        at com.example.demo.PostResourceClient$$CDIWrapper_Bean.create(PostResourceClient$$CDIWrapper_Bean.zig:210)
        at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96)
        at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
        at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
        at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
        at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
        at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
        at com.example.demo.PostResourceClient$$CDIWrapper_Bean.get(PostResourceClient$$CDIWrapper_Bean.zig:242)
        at com.example.demo.PostResourceClient$$CDIWrapper_Bean.get(PostResourceClient$$CDIWrapper_Bean.zig:258)
        at com.example.demo.PostController_Bean.create(PostController_Bean.zig:208)
        ... 29 more
Caused by: org.jboss.resteasy.reactive.client.api.InvalidRestClientDefinitionException: Failed to generate client for class interface com.example.demo.PostResourceClient : Cannot invoke "org.jboss.jandex.ClassInfo.interfaceNames()" because the return value of "org.jboss.jandex.IndexView.getClassByName(org.jboss.jandex.DotName)" is null
        at org.jboss.resteasy.reactive.client.impl.ClientProxies.get(ClientProxies.java:23)
        at org.jboss.resteasy.reactive.client.impl.WebTargetImpl.proxy(WebTargetImpl.java:373)
        at io.quarkus.rest.client.reactive.runtime.RestClientBuilderImpl.build(RestClientBuilderImpl.java:273)

The source codes: https://github.com/hantsy/quarkus-sandbox/tree/master/restclient-reactive
The target remote API is https://github.com/hantsy/quarkus-sandbox/tree/master/post-service

@hantsy hantsy added the kind/bug Something isn't working label May 8, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented May 8, 2021

/cc @michalszynkiewicz

@geoand geoand self-assigned this May 8, 2021
geoand added a commit to geoand/quarkus that referenced this issue May 8, 2021
geoand added a commit that referenced this issue May 10, 2021
Fix issue with primitive param types in rest client
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest-client kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants