Open cvgaviao opened 3 months ago
Can you please provide a small reproducer?
Hello @gastaldi ,
I think I found a workaround / solution for this problem.
We should inform the concrete class on the entityType parameter of @RestLink:
@RestLink(entityType = ImmutableUserDto.class)
I will proper test it as soon I return from vacation.
@cvgaviao where you perhaps able to test your fix?
Hello @geoand,
I tested it today.
Besides using the fact that using the entityType property of @RestLink have prevented it to give an error, it not work as expected: I didn't see any link on the response.
Maybe it is because I'm using Immutables and its builders, and it unfortunately doesn't allow us to generate public constructors.
Thanks for the update.
Can you please provide a small reproducer?
Uping this :)
Let's close this for now. If a reproducer becomes available, please attach it and we can reopen the issue
Let's close this for now. If a reproducer becomes available, please attach it and we can reopen the issue
Sorry. I will do that in the next weekend. things are in a rush here in my job recently.
👌
Hello @geoand , there is the reproducer.
Try to call 'http://localhost:8080/users/1' and you see the error I got.
But now the error is different than the one I got when I created this issue though (use of entityType = ImmutableUserDto.class
).
java.lang.NullPointerException:
Cannot invoke "java.util.Map.get(Object)" because the return value of "java.util.Map.get(Object)" is null
at io.quarkus.resteasy.reactive.links.runtime.GetterAccessorsContainer.get(GetterAccessorsContainer.java:14)
at io.quarkus.resteasy.reactive.links.runtime.RestLinksProviderImpl.getPathParameterValues(RestLinksProviderImpl.java:65)
at io.quarkus.resteasy.reactive.links.runtime.RestLinksProviderImpl.getInstanceLinks(RestLinksProviderImpl.java:57)
at io.quarkus.resteasy.reactive.links.RestLinksProviderProducer_ProducerMethod_restLinksProvider_eGzDuhQoSV1-UbOUneVkE4POzbM_ClientProxy.getInstanceLinks(Unknown Source)
at io.quarkus.resteasy.reactive.links.RestLinksHandler.getLinks(RestLinksHandler.java:38)
at io.quarkus.resteasy.reactive.links.RestLinksHandler.handle(RestLinksHandler.java:29)
at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:150)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
at org.jboss.resteasy.reactive.server.vertx.VertxResteasyReactiveRequestContext$1$1.handle(VertxResteasyReactiveRequestContext.java:84)
at org.jboss.resteasy.reactive.server.vertx.VertxResteasyReactiveRequestContext$1$1.handle(VertxResteasyReactiveRequestContext.java:81)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:270)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:252)
at io.vertx.core.impl.ContextInternal.lambda$runOnContext$0(ContextInternal.java:50)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
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:1583)
Thanks, I'll have a look soon
cc @Sgitario
Description
I'm using Immutable to generate some immutable DTOs.
I also created an @InjectId annotation to instruct Immutables to add the @Id on the generated class.
But I still getting this error:
Caused by: java.lang.IllegalStateException: Cannot generate web links for the class myproject.dtos.UserDto because it is either missing an
idfield, a field with an
@Idannotation or a field with a
@RestLinkId annotationImplementation ideas
No response