【发布时间】:2020-08-08 11:06:34
【问题描述】:
在 Spring boot AOP 应用程序中,我有一个切入点 @target(MyAnnotation) || @annotation(MyAnnotation)。
如果将 MyAnnotation 放在执行带有此注解的对象或注解的方法上,则应执行建议。
当我运行应用程序时,我得到
java.lang.IllegalArgumentException: Cannot subclass final class org.springframework.cloud.sleuth.log.Slf4jScopeDecorator
here 讨论了一个类似的问题,但似乎切入点太宽,我的不是因为我在项目中只有几个带有 MyAnnotation 的注释类。
我把这个注解放到feign客户端界面上,像这样。
@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