Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NoSuchMethodError in mvc-annotation-commons&change deprecated method #658

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ Release Notes.
9.2.0
------------------

* Fix NoSuchMethodError in mvc-annotation-commons and change deprecated method


#### Documentation

Original file line number Diff line number Diff line change
@@ -168,11 +168,11 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
next.setHeadValue(serverHttpRequest.getHeaders().getFirst(next.getHeadKey()));
}

String operationName = this.buildOperationName(method, serverHttpRequest.getMethodValue(),
String operationName = this.buildOperationName(method, serverHttpRequest.getMethod().name(),
(EnhanceRequireObjectCache) objInst.getSkyWalkingDynamicField());
AbstractSpan span = ContextManager.createEntrySpan(operationName, contextCarrier);
Tags.URL.set(span, serverHttpRequest.getURI().toString());
Tags.HTTP.METHOD.set(span, serverHttpRequest.getMethodValue());
Tags.HTTP.METHOD.set(span, serverHttpRequest.getMethod().name());
span.setComponent(ComponentsDefine.SPRING_MVC_ANNOTATION);
SpanLayer.asHttp(span);

23 changes: 15 additions & 8 deletions test/plugin/scenarios/spring-6.x-scenario/pom.xml
Original file line number Diff line number Diff line change
@@ -29,8 +29,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.version>1.8</compiler.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<compiler.version>17</compiler.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<test.framework.version>6.0.0</test.framework.version>
<test.framework>spring</test.framework>
</properties>
@@ -62,30 +62,36 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.3</version>
<version>2.14.3</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
<version>2.9.1</version>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.0.0</version>
<version>4.10.0</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.8.1</version>
<version>2.19.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.1</version>
<version>2.19.0</version>
</dependency>

<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
</dependency>
</dependencies>

@@ -101,6 +107,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<parameters>true</parameters>
<source>${compiler.version}</source>
<target>${compiler.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
@@ -119,4 +126,4 @@
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>
</project>
Original file line number Diff line number Diff line change
@@ -15,3 +15,5 @@
# limitations under the License.

6.0.4
6.1.0
6.1.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, only this is using SpringBoot 3.2.0, which was failing before the fix, am I getting your idea correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I tracd my own springboot project in 3.2.0(Spring 6.1.1), and find SpringMVC node missing, but springboot project in 3.1.6(Spring 6.0.14) works.