Commit 98d39fa
committed
Fix Spring MVC plugin: check javax and jakarta servlet independently
When both javax.servlet and jakarta.servlet exist on the classpath
(e.g., Spring MVC 6.x app with javax.servlet as transitive dependency),
the exclusive if/else in the static initializer set IS_JAVAX=true and
skipped the Jakarta check. At runtime, the request was jakarta type but
IS_JAKARTA was false, causing IllegalStateException("this line should
not be reached").
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 already select the correct branch.1 parent 856a656 commit 98d39fa
File tree
1 file changed
+11
-9
lines changed- apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor
1 file changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | | - | |
80 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
81 | 91 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
0 commit comments