-
Notifications
You must be signed in to change notification settings - Fork 358
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
NPE after switching to jersey-micrometer #5687
Comments
Note that while the above log says it is a warning, this breaks the server completely, so it's kind of a major problem. |
Some good news, it seems this does not happen when I call Jersey paths, but if I call an path that is not found on the server, I receive a NPE from the API instead of the 404. |
It would be still nice to fix this so it doesn't crash and returns 404 as expected. Metric instrumentation should not leak errors up to the servlet response, IMO. |
Odd, as 404 case is handled right before this NPE occurs: jersey/ext/micrometer/src/main/java/org/glassfish/jersey/micrometer/server/JerseyKeyValues.java Line 91 in ed233c5
So for 404, it should never get to |
This is how my API response looks like when I remove
But when I use
I believe, there are two problems:
|
And possibly a third problem is that the 404 check doesn't cover the case when the 404 is from a WebApplicationException like with Jersey: Here is the stacktrace of that 404 exception in case it helps:
|
Forgot to add the library versions I am using:
|
After upgrading to Spring Boot 3.3 with Micrometer 1.13 I followed the upgrade instructions to add a dependency on
org.glassfish.jersey.ext:jersey-micrometer
I noticed that after the upgrade, this new library is throwing NPEs from the servlet:
It seems the library does not handle null values properly and causing unexpected failures during servlet processing.
Here is the problematic part:
jersey/ext/micrometer/src/main/java/org/glassfish/jersey/micrometer/server/JerseyKeyValues.java
Lines 95 to 98 in ed233c5
Where
JerseyTags.getMatchingPattern
is a nullable method, but the return value is not checked and causes NPE at runtime.The text was updated successfully, but these errors were encountered: