Replies: 1 comment
-
javax VS Jakata is a long story. AFAIK, Spring supports both of them. Spring6 plugins worked in the test scenarios. https://github.com/apache/skywalking-java/blob/main/test/plugin/scenarios/spring-6.x-scenario/support-version.list If you need Jakata, we may need to split that interceptor into two for javax and Jakata, rather than just replacement. It will break another group of people. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Search before asking
Apache SkyWalking Component
Java Agent (apache/skywalking-java)
What happened
The Spring 6.x plugin (
mvc-annotation-6.x-plugin
) is being incorrectly activated when using Spring Framework 5.3.13, causing runtime errors due to API incompatibilities between Spring 5.x and Spring 6.x.The issue is in the witness class selection in
AbstractSpring6Instrumentation
:The
HttpResource
class exists in Spring Framework since version 5.0 (as documented here), making it an imprecise witness class for detecting Spring 6.x.Error Details
ERROR 2025-06-26 12:06:24.943 XNIO-1 task-4 InstMethodsInter : class[class org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod] after method[getBean] intercept failure java.lang.NoSuchMethodError: org.springframework.web.context.request.ServletRequestAttributes.getRequest()Ljakarta/servlet/http/HttpServletRequest; at org.apache.skywalking.apm.plugin.spring.mvc.v6.GetBeanInterceptor.afterMethod(GetBeanInterceptor.java:51)
Analysis
javax.servlet.*
APIsjakarta.servlet.*
APIsServletRequestAttributes.getRequest()
method returns different types:javax.servlet.http.HttpServletRequest
jakarta.servlet.http.HttpServletRequest
HttpResource
exists in both Spring 5.x and 6.x, the witness class check passes incorrectlyWhat you expected to happen
mvc-annotation-5.x-plugin
mvc-annotation-6.x-plugin
How to reproduce
Anything else
Replace the witness class in
AbstractSpring6Instrumentation
with a class that only exists in Spring 6.xAny recommended classes?
If my thinking is wrong, please tell me.
Are you willing to submit a pull request to fix on your own?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions