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
org.glassfish.jersey.server.internal.routing.UriRoutingContext class initializes org.glassfish.jersey.message.internal.TracingLogger to TracingLogger.EMPTY due to order of calls from org.glassfish.jersey.servlet.WebComponent#serviceImpl.
Reproduce steps:
Run Jersey 3.1.5 (latest 3.1.x as of March 2024) as a Jetty Servlet filter
Expected: UriRoutingContext emits events like MATCH_RESOURCE_METHOD
Actual: No events are emitted due to no-op implementation of a tracingLogger
I suspect that this is due to order of calls coming from WebComponent:
Firstly, a call to TracingLogger.getInstance() sets an EMPTY in UriRoutingContext.tracingLogger. It reads the configuration from a ContainerRequest:
at org.glassfish.jersey.message.internal.TracingLogger.getInstance(TracingLogger.java:116)
at org.glassfish.jersey.server.internal.routing.UriRoutingContext.<init>(UriRoutingContext.java:89)
at org.glassfish.jersey.server.ContainerRequest.<init>(ContainerRequest.java:170)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:389)
at org.glassfish.jersey.servlet.ServletContainer.serviceImpl(ServletContainer.java:377)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:552)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:493)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:430)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
Secondly, a call to TracingUtils.initTracingSupport() initializes a org.glassfish.jersey.message.internal.TracingLogger#PROPERTY_NAME in a ContainerRequest. It's too late for a UriRoutingContext to take advantage of it:
at org.glassfish.jersey.server.TracingUtils.initTracingSupport(TracingUtils.java:65)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:206)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:697)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
at org.glassfish.jersey.servlet.ServletContainer.serviceImpl(ServletContainer.java:377)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:552)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:493)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:430)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
The text was updated successfully, but these errors were encountered:
org.glassfish.jersey.server.internal.routing.UriRoutingContext
class initializesorg.glassfish.jersey.message.internal.TracingLogger
toTracingLogger.EMPTY
due to order of calls fromorg.glassfish.jersey.servlet.WebComponent#serviceImpl
.Reproduce steps:
Expected:
UriRoutingContext
emits events likeMATCH_RESOURCE_METHOD
Actual: No events are emitted due to no-op implementation of a
tracingLogger
I suspect that this is due to order of calls coming from
WebComponent
:TracingLogger.getInstance()
sets anEMPTY
inUriRoutingContext.tracingLogger
. It reads the configuration from aContainerRequest
:TracingUtils.initTracingSupport()
initializes aorg.glassfish.jersey.message.internal.TracingLogger#PROPERTY_NAME
in aContainerRequest
. It's too late for aUriRoutingContext
to take advantage of it:The text was updated successfully, but these errors were encountered: