Skip to content

Commit fdc1e97

Browse files
authored
Fix NoSuchMethodError in mvc-annotation-commons&change deprecated method (#658)
1 parent 045c1e7 commit fdc1e97

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

CHANGES.md

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

8+
* Fix NoSuchMethodError in mvc-annotation-commons and change deprecated method
9+
810

911
#### Documentation
1012

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
168168
next.setHeadValue(serverHttpRequest.getHeaders().getFirst(next.getHeadKey()));
169169
}
170170

171-
String operationName = this.buildOperationName(method, serverHttpRequest.getMethodValue(),
171+
String operationName = this.buildOperationName(method, serverHttpRequest.getMethod().name(),
172172
(EnhanceRequireObjectCache) objInst.getSkyWalkingDynamicField());
173173
AbstractSpan span = ContextManager.createEntrySpan(operationName, contextCarrier);
174174
Tags.URL.set(span, serverHttpRequest.getURI().toString());
175-
Tags.HTTP.METHOD.set(span, serverHttpRequest.getMethodValue());
175+
Tags.HTTP.METHOD.set(span, serverHttpRequest.getMethod().name());
176176
span.setComponent(ComponentsDefine.SPRING_MVC_ANNOTATION);
177177
SpanLayer.asHttp(span);
178178

test/plugin/scenarios/spring-6.x-scenario/pom.xml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
<properties>
3131
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
32-
<compiler.version>1.8</compiler.version>
33-
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
32+
<compiler.version>17</compiler.version>
33+
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
3434
<test.framework.version>6.0.0</test.framework.version>
3535
<test.framework>spring</test.framework>
3636
</properties>
@@ -62,30 +62,36 @@
6262
<dependency>
6363
<groupId>com.fasterxml.jackson.core</groupId>
6464
<artifactId>jackson-databind</artifactId>
65-
<version>2.9.3</version>
65+
<version>2.14.3</version>
6666
</dependency>
6767

6868
<dependency>
6969
<groupId>com.google.code.gson</groupId>
7070
<artifactId>gson</artifactId>
71-
<version>2.8.2</version>
71+
<version>2.9.1</version>
7272
</dependency>
7373

7474
<dependency>
7575
<groupId>com.squareup.okhttp3</groupId>
7676
<artifactId>okhttp</artifactId>
77-
<version>3.0.0</version>
77+
<version>4.10.0</version>
7878
</dependency>
7979

8080
<dependency>
8181
<groupId>org.apache.logging.log4j</groupId>
8282
<artifactId>log4j-api</artifactId>
83-
<version>2.8.1</version>
83+
<version>2.19.0</version>
8484
</dependency>
8585
<dependency>
8686
<groupId>org.apache.logging.log4j</groupId>
8787
<artifactId>log4j-core</artifactId>
88-
<version>2.8.1</version>
88+
<version>2.19.0</version>
89+
</dependency>
90+
91+
<dependency>
92+
<groupId>jakarta.servlet</groupId>
93+
<artifactId>jakarta.servlet-api</artifactId>
94+
<version>6.0.0</version>
8995
</dependency>
9096
</dependencies>
9197

@@ -101,6 +107,7 @@
101107
<artifactId>maven-compiler-plugin</artifactId>
102108
<version>${maven-compiler-plugin.version}</version>
103109
<configuration>
110+
<parameters>true</parameters>
104111
<source>${compiler.version}</source>
105112
<target>${compiler.version}</target>
106113
<encoding>${project.build.sourceEncoding}</encoding>
@@ -119,4 +126,4 @@
119126
<url>https://repo.spring.io/milestone</url>
120127
</pluginRepository>
121128
</pluginRepositories>
122-
</project>
129+
</project>

test/plugin/scenarios/spring-6.x-scenario/support-version.list

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
# limitations under the License.
1616

1717
6.0.4
18+
6.1.0
19+
6.1.1

0 commit comments

Comments
 (0)