You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My application throws an exception inside a ContainerRequestFilter. This exception is then catched an converted to a 400 status code inside an ExceptionMapper.
This setup works fine in Resteasy Classic - status code 400 ist returned, and no exception.
In Resteasy Reactive, I get the exception from below and an 500 status code.
When I remove the ExceptionMapper, the RuntimeException is logged as expected, but no NPE is thrown.
Expected behavior
No exceptions. Correct response that was set in the ExceptionMapper.
Actual behavior
__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2021-04-19 11:30:50,075 INFO [io.quarkus] (Quarkus Main Thread) rr-rest-metrics 1.0.0-SNAPSHOT on JVM (powered by Quarkus 1.13.2.Final) started in 3.215s. Listening on: http://localhost:8080
2021-04-19 11:30:50,077 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-04-19 11:30:50,077 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, mutiny, resteasy-reactive, smallrye-context-propagation, smallrye-metrics]
2021-04-19 11:31:11,471 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (vert.x-eventloop-thread-2) HTTP Request to /hello-resteasy-reactive failed, error id: 6347e5ea-b5a9-4ec4-94f6-e06d7ec92ebd-1: java.lang.NullPointerException
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter.filter(QuarkusRestMetricsFilter.java:15)
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter.filter(QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter.zig:68)
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass.filter$$superaccessor1(QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass.zig:213)
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass$$function$$1.apply(QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass$$function$$1.zig:41)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass.filter(QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass.zig:168)
at org.jboss.resteasy.reactive.server.handlers.ResourceResponseFilterHandler.handle(ResourceResponseFilterHandler.java:24)
at org.jboss.resteasy.reactive.server.handlers.ResourceResponseFilterHandler.handle(ResourceResponseFilterHandler.java:9)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:122)
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:1038)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:137)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:132)
at io.quarkus.vertx.http.runtime.StaticResourcesRecorder.lambda$start$1(StaticResourcesRecorder.java:65)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1038)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:101)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:132)
at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$sendStatic$1(StaticHandlerImpl.java:206)
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:327)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
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:834)
2021-04-19 11:31:11,480 ERROR [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (vert.x-eventloop-thread-2) Request failed: java.lang.NullPointerException
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter.filter(QuarkusRestMetricsFilter.java:15)
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter.filter(QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter.zig:68)
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass.filter$$superaccessor1(QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass.zig:213)
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass$$function$$1.apply(QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass$$function$$1.zig:41)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
at io.quarkus.smallrye.metrics.runtime.QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass.filter(QuarkusRestMetricsFilter$GeneratedServerResponseFilter$filter_Subclass.zig:168)
at org.jboss.resteasy.reactive.server.handlers.ResourceResponseFilterHandler.handle(ResourceResponseFilterHandler.java:24)
at org.jboss.resteasy.reactive.server.handlers.ResourceResponseFilterHandler.handle(ResourceResponseFilterHandler.java:9)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:122)
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:1038)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:137)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:132)
at io.quarkus.vertx.http.runtime.StaticResourcesRecorder.lambda$start$1(StaticResourcesRecorder.java:65)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1038)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:101)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:132)
at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$sendStatic$1(StaticHandlerImpl.java:206)
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:327)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
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:834)
To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
Or attach an archive containing the reproducer to the issue.
Describe the bug
My application throws an exception inside a
ContainerRequestFilter
. This exception is then catched an converted to a 400 status code inside anExceptionMapper
.This setup works fine in Resteasy Classic - status code 400 ist returned, and no exception.
In Resteasy Reactive, I get the exception from below and an 500 status code.
When I remove the
ExceptionMapper
, the RuntimeException is logged as expected, but no NPE is thrown.Expected behavior
No exceptions. Correct response that was set in the ExceptionMapper.
Actual behavior
To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
Or attach an archive containing the reproducer to the issue.
Steps to reproduce the behavior:
Configuration
quarkus.smallrye-metrics.jaxrs.enabled=true
Environment (please complete the following information):
Output of
uname -a
orver
MSYS_NT-10.0 NANB7NLNVP2 2.10.0(0.325/5/3) 2018-06-13 23:34 x86_64 Msys
Quarkus version or git rev
1.13.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\eclipse\tools\apache-maven\bin..
Java version: 11.0.7, vendor: Azul Systems, Inc., runtime: C:\eclipse\tools\zulu11.39.15-ca-jdk11.0.7-win_x64
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
The text was updated successfully, but these errors were encountered: