You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/08/20 12:19:27 UTC

[GitHub] [skywalking] whfjam opened a new issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

whfjam opened a new issue #5359:
URL: https://github.com/apache/skywalking/issues/5359


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [*] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   when i use @Aspect Annotation in a spring cloud app it has some infos , the bootstrap log has some info like 
   ___
   ### Bug
   - Which version of SkyWalking, OS and JRE?
   
   - Which company or project?
   
   - What happened?
   If possible, provide a way to reproduce the error. e.g. demo application, component version.
   
   ___
   ### Requirement or improvement
   - Please describe your requirements or improvement suggestions.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] kezhenxu94 closed issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
kezhenxu94 closed issue #5359:
URL: https://github.com/apache/skywalking/issues/5359


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] kezhenxu94 edited a comment on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
kezhenxu94 edited a comment on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-711103098


   This doesn’t effect the application’s logic, it just says the added internal methods cannot be instrumented, but the original one is still there to take effect. According to the codes, I think you only want to print the arguments of the controller, nothing to do with the internal methods added by SkyWalking, right?
   
   
   I think you should rewrite your pointcut to only intercept methods that are `public` or annotated with `@RequestMapping`(or `@GetMapping` and other similar for POST, ect.), intercepting all methods in a controller is not realistic in a real scenario(it’s very likely that we have private methods in a controller) and I consider it as a bad practice(it costs too much extra and unnecessarily)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] kezhenxu94 commented on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-711103098


   I think you should rewrite your pointcut to only intercept methods that are `public` or annotated with `@RequestMapping`(or `@GetMapping` and other similar for POST, ect.), intercepting all methods in a controller is not realistic in a real scenario(it’s very likely that we have private methods in a controller) and I consider it as a bad practice(it costs too much extra and unnecessarily)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] whfjam commented on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
whfjam commented on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-677674238


   > 
   > 
   > Are you using agent to instrument that class and method as well? Please provide the full error stack.
   
   yes i did, it seemed like just an info log not an error
   i had a controller like below
   ---------------------------------
   @Controller
   public class TestController {
   
   
       @RequestMapping(path = "v2/test2/{fileId}",method = RequestMethod.GET)
       public String getMsg(@PathVariable String fileId){
           new RuntimeException().printStackTrace();
           return "1TT-"+fileId;
       }
   }
   --------------------------------
   then i had a aop like below
   --------------------------------
   @Aspect
   @Component
   public class ParamValiAspect {
   
       @Pointcut("execution (* com.timevale.skwka.service.*.*(..))")
       public void doAspect() {
   
       }
   
       @Around("doAspect()")
       public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
           Object[] args = joinPoint.getArgs();
           for(Object arg: args){
               if(arg == null) {
                   continue;
               }
              System.out.println("arg:"+arg);
           }
   
           return joinPoint.proceed();
       }
   }
   --------------------------------------
   
   in the startup logs i found this :
   
   INFO  org.springframework.aop.framework.CglibAopProxy - Unable to proxy method [final java.lang.String com.timevale.skwka.service.TestController.getMsg$original$btT8GaHU$accessor$vhlk7XnS(java.lang.String)] because it is final: All calls to this method via a proxy will NOT be routed to the target instance.
   
   
   if without skywalkingagent it would not happen


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-677684138


   Does this affect your application? This is because we(byte-buddy) added some internal method(final) in your Controller at the runtime. And Spring doesn't support to do `AOP` thing, so this error/warning shows up.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] kezhenxu94 edited a comment on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
kezhenxu94 edited a comment on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-711103098


   This doesn’t effect the application’s logic, it just says the added internal methods cannot be intercepted, but the original one is still there to take effect. According to the codes, I think you only want to print the arguments of the controller, nothing to do with the internal methods added by SkyWalking, right?
   
   
   I think you should rewrite your pointcut to only intercept methods that are `public` or annotated with `@RequestMapping`(or `@GetMapping` and other similar for POST, ect.), intercepting all methods(including private methods) in a controller is not realistic in a real scenario(it’s very likely that we have private methods in a controller) and I consider it as a bad practice(it costs too much extra and unnecessarily)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-678276186


   Sure, Let's continue after you have more feedback.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-677643476


   Are you using agent to instrument that class and method as well? Please provide the full error stack.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] kezhenxu94 edited a comment on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
kezhenxu94 edited a comment on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-711103098


   This doesn’t effect the application’s logic, it just says the added internal methods cannot be intercepted, but the original one is still there to take effect. According to the codes, I think you only want to print the arguments of the controller, nothing to do with the internal methods added by SkyWalking, right?
   
   
   I think you should rewrite your pointcut to only intercept methods that are `public` or annotated with `@RequestMapping`(or `@GetMapping` and other similar for POST, ect.), intercepting all methods in a controller is not realistic in a real scenario(it’s very likely that we have private methods in a controller) and I consider it as a bad practice(it costs too much extra and unnecessarily)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] whfjam commented on issue #5359: when i use @Aspect Annotation in a spring cloud app it has some infos

Posted by GitBox <gi...@apache.org>.
whfjam commented on issue #5359:
URL: https://github.com/apache/skywalking/issues/5359#issuecomment-677724118


   > 
   > 
   > Does this affect your application? This is because we(byte-buddy) added some internal method(final) in your Controller at the runtime. And Spring doesn't support to do `AOP` thing, so this error/warning shows up.
   
   I think i should learn more about this and test more , then i will tell you about if this could affect my application


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org