| @annotation(MyAnnotation). Advice should be executed if MyAnnotation is put either on executing object annotated with this ...

问题描述 投票:0回答:1
Ok, after hours of investigation I replaced my pointcut with this one

As explained @target(MyAnnotation) || @annotation(MyAnnotation)hereMyAnnotation I used only

to avoid proxy creation. Hope this helps

java.lang.IllegalArgumentException: Cannot subclass final class org.springframework.cloud.sleuth.log.Slf4jScopeDecorator

在Spring Boot AOP应用程序中,我有一个点阵图。. 在下列情况下应执行建议: MyAnnotation 被放在用此注解的执行对象或注解的方法上。

当我运行应用程序时,我得到

@MyAnnotation
@FeignClient(name="some-name", url="http://test.url")
public interface MyClient {
    @RequestMapping(method = RequestMethod.GET, value = "/endpoint")
    List<Store> getSomething();
}

一个类似的问题将被讨论

此处
aop spring-aop pointcut
1个回答
0
投票

我把这个注释装成客户端界面,像这样。

@Around("execution(* (@MyAnnotation *).*(..)) || execution(@MyAnnotation * *(..))")

有什么想法,我的pointcut有什么问题吗? execution在Spring Boot AOP应用中,我有一个点切 @target(MyAnnotation)

© www.soinside.com 2019 - 2024. All rights reserved.