Skip to content

Commit f572a76

Browse files
authored
Fix include_http_headers on Spring Boot 3.x/Jakarta, unify Tomcat/Jetty servlet plugins (#13938) (#812)
* Fix include_http_headers on Spring Boot 3.x/Jakarta, unify Tomcat/Jetty servlet plugins (#13938) Add a shared servlet-commons module: a JDK-typed, namespace-agnostic servlet request/response wrapper that resolves javax.servlet vs jakarta.servlet at runtime through a single dispatch point. Refactor the Spring MVC commons onto it, removing the fragile static javax/jakarta detection that silently dropped plugin.http.include_http_headers on Jakarta (Spring Boot 3.x) applications. Merge the duplicated servlet plugin pairs, each now covering both namespaces: - tomcat-7.x-8.x + tomcat-10x -> tomcat - jetty-server-9.x + jetty-server-11.x -> jetty-server Breaking change: the plugin definition names change accordingly; update any plugin.exclude_plugins (SW_EXCLUDE_PLUGINS) settings referencing the old names. Add E2E scenarios spring-boot-3.x (Boot 3 embedded Tomcat 10, jakarta) and spring-boot-2.x (Boot 2, javax mirror), both asserting http.headers and http.params; port the tomcat/jetty interceptor unit tests to the merged modules; bump jakarta framework versions (one per minor); update docs. * Add servlet-commons provided dependency to mvc-annotation-4.x-plugin Its interceptor unit tests exercise the commons AbstractMethodInterceptor, which now references servlet-commons' HttpRequestWrappers. Since commons declares servlet-commons at provided (non-transitive) scope, it was absent from the 4.x plugin's test classpath, causing NoClassDefFoundError in CI.
1 parent a9b0cf4 commit f572a76

99 files changed

Lines changed: 2925 additions & 1237 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/plugins-jdk17-test.1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
matrix:
7272
case:
7373
- spring-6.x-scenario
74+
- spring-boot-3.x-scenario
7475
- resteasy-6.x-scenario
7576
- gateway-4.x-scenario
7677
- gateway-4.1.2.x-scenario

.github/workflows/plugins-test.2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
- rabbitmq-scenario
7575
- redisson-scenario
7676
- resttemplate-4.x-scenario
77+
- spring-boot-2.x-scenario
7778
- servicecomb-1.x-scenario
7879
- servicecomb-2.x-scenario
7980
- shardingsphere-3.x-scenario

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Release Notes.
55
9.7.0
66
------------------
77

8+
* Fix `plugin.http.include_http_headers` not working on Spring Boot 3.x / Jakarta EE (apache/skywalking#13938).
9+
* Unify the Tomcat plugins into a single `tomcat` plugin (Tomcat 7 - 10) and the Jetty server plugins into a single `jetty-server` plugin (Jetty 9 - 11), each supporting both `javax.servlet` and `jakarta.servlet`. Breaking change: plugin names `tomcat-7.x/8.x` and `tomcat-10.x` are replaced by `tomcat`, and `jetty-server-9.x` and `jetty-server-11.x` by `jetty-server`; update `plugin.exclude_plugins` if you reference the old names.
810
* Added support for Lettuce reactive Redis commands.
911
* Add Spring AI 1.x plugin and GenAI layer.
1012
* Fix httpclient-5.x plugin injecting sw8 propagation headers into ClickHouse HTTP requests (port 8123), causing HTTP 400. Add `PROPAGATION_EXCLUDE_PORTS` config to skip tracing (including header injection) for specified ports in the classic client interceptor.

apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-11.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v11/server/ForwardInterceptor.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-11.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v11/server/define/AbstractWitnessInstrumentation.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/pom.xml

Lines changed: 0 additions & 45 deletions
This file was deleted.

apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/server/HandleInterceptor.java

Lines changed: 0 additions & 90 deletions
This file was deleted.

apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/server/define/DispatcherInstrumentation.java

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)