我正在使用Spring-AspetJ 3.2.11支持。我希望我的方面在方法级别或类级别上捕获注释,但spring似乎不喜欢切入点。这是我正在尝试的,在这种情况下ConvertRuntimeException是一个注释:
@Around( "execution(public * *(..)) and ( @within(uncaughtClass) or @annotation(uncaughtMethod) )" )
public Object execute(ProceedingJoinPoint jp, ConvertRuntimeException uncaughtClass, ConvertRuntimeException uncaughtMethod ) throws Throwable {
我得到的错误是:
WARN - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'convertRuntimeAdviceTest.TestConfig1': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 inconsistent binding
如果我只使用类级切入点(删除或),一切正常。我想我可以用两个单独的绑定来做到这一点,但我希望这个方法胜过类级别。这里最好的方法是什么?
谢谢,