Skip to content
Discussion options

You must be logged in to vote

This is a confirmed bug in the Spring MVC plugin. Fixed in apache/skywalking-java#803.

Root cause: The static initializer in AbstractMethodInterceptor checks javax.servlet and jakarta.servlet in an exclusive if/else. If javax.servlet is found first (even as a
transitive dependency), IS_JAVAX=true is set and the Jakarta check is skipped. At runtime, the request is jakarta.servlet.http.HttpServletRequest but IS_JAKARTA is false, so
no branch matches and IllegalStateException("this line should not be reached") is thrown.

Fix: Check both servlet APIs independently — both IS_JAVAX and IS_JAKARTA can be true. The runtime isAssignableFrom checks on the actual request object type select the correct

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wu-sheng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants