[Bug] JavaAgent does not support the default method in the interface #9502
byspacecbk
started this conversation in
General
Replies: 2 comments 3 replies
-
|
You could read the source codes to get the details, https://github.com/apache/skywalking-java/blob/4b564ade6469e9827c63b4e7e5c97df41663000b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/define/AbstractControllerInstrumentation.java#L109 AFAIK, the current plugin requires a class-level annotation( |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
Thank you very much for your reply
After trying, I found that there is no problem with inheritance, but not with interface. When I use the interface default method, no matter how I request the default method, skywalking cannot get any endpoint data.
Specific codes are as follows:
1、Use interface implementation,Skywalking cannot capture any data
=============================================================================================
2、Using inheritance, skywalking can capture normal data
…------------------ 原始邮件 ------------------
发件人: "apache/skywalking" ***@***.***>;
发送时间: 2022年8月22日(星期一) 下午2:55
***@***.***>;
***@***.******@***.***>;
主题: Re: [apache/skywalking] [Bug] JavaAgent does not support the default method in the interface (Discussion #9502)
You could read the source codes to get the details, https://github.com/apache/skywalking-java/blob/4b564ade6469e9827c63b4e7e5c97df41663000b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/define/AbstractControllerInstrumentation.java#L109
AFAIK, the current plugin requires a class-level ***@***.*** or @controller).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
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
In the springboot project, the controller class implements an interface with a default method (a new feature of Java 8). The default method of this interface can be called, but skywalking does not record it. I have used the latest version of skywalking.
What you expected to happen
the controller class implements an interface with a default method (a new feature of Java 8)
How to reproduce
In the springboot project, the controller class implements an interface with a default method (a new feature of Java 8). The default method of this interface can be called, but skywalking does not record it.
public interface ClusterTest2Controller {
@GetMapping("/_query")
@QueryAction
@QueryOperation(summary = "queryPager")
default Mono queryPager() {
System.out.println("=================queryPager=====================");
return Mono.empty();
}
}
@RequestMapping("/cluster2")
@RestController
@authorize
@tag(name = "cluster2")
public class ClusterTestController implements ClusterTest2Controller{
}
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions