Skip to content

Fix class cast exception in servlet instrumentation#16403

Merged
laurit merged 1 commit intoopen-telemetry:mainfrom
laurit:servlet-class-cast
Mar 9, 2026
Merged

Fix class cast exception in servlet instrumentation#16403
laurit merged 1 commit intoopen-telemetry:mainfrom
laurit:servlet-class-cast

Conversation

@laurit
Copy link
Copy Markdown
Contributor

@laurit laurit commented Mar 6, 2026

Resolves #16393
Introduced with #15473
Alternative for #16396 (tests are copied from #16396).
In #15473 MappingResolver was moved out from boot loader, this PR moves it back.

}
}

private static String readFully(InputStream is) throws Exception {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you would like to simplify a bit the code then this method could be replaced with call to org.apache.commons.io.IOUtils.toString(InputStream)

Copy link
Copy Markdown
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #15473 MappingResolver was moved out from boot loader, this PR moves it back.

👍

@trask trask added this to the v2.26.0 milestone Mar 6, 2026
@laurit laurit merged commit 443f7a3 into open-telemetry:main Mar 9, 2026
93 checks passed
@laurit laurit deleted the servlet-class-cast branch March 9, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClassCastException for JakartaServletFilterMappingResolverFactory introduced in 2.23.0 with servlet filter

4 participants