I'm currently trying to inject and read out the HttpRequest in Quarkus 1.13 but without any success. I'm using RESTEasy-Reactive for my endpoint.
This is how I'm currently including it
@Path("/users/{id}")
class UserController(
@Inject val service: UserService,
@Context val httpRequest: io.vertx.core.http.HttpServerRequest,
)
...
The build process succeeds but when I try to access a property like httpRequest.absoluteURI()
I am getting an NPE
java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext.serverRequest()" because the return value of "org.jboss.resteasy.reactive.server.core.CurrentRequestManager.get()" is null
at io.quarkus.resteasy.reactive.server.runtime.QuarkusContextProducers.httpServerRequest(QuarkusContextProducers.java:26)
at io.quarkus.resteasy.reactive.server.runtime.QuarkusContextProducers_Subclass.httpServerRequest$$superaccessor3(QuarkusContextProducers_Subclass.zig:451)
at io.quarkus.resteasy.reactive.server.runtime.QuarkusContextProducers_Subclass$$function$$3.apply(QuarkusContextProducers_Subclass$$function$$3.zig:29)
...
I also tried other classes like io.vertx.mutiny.core.http.HttpServerRequest
or java.net.http.HttpRequest
but still without success. Injecting it with @Inject
didn't even build. I'm missing the HttpServletRequest
class :/
Anybody got an idea?