这个错误
Error creating bean with name ‘projectingArgumentResolverBeanPostProcessor’
发生的原因:切入点错误
@Aspect
@Component
public class ModelViewAspect {
//设置切入点:这里直接拦截被@ModelView注解的方法
@Pointcut("@annotation(com.example.mytoken.config.exception.ModelView)")
public void pointcut() { }
/**
* 当有ModelView的注解的方法抛出异常的时候,做如下的处理
*/
@AfterThrowing(pointcut="pointcut()",throwing="e")
public void afterThrowable(Throwable e) {
if(e instanceof CustomException){
throw ModelViewException.transfer((CustomException) e);
}
}
}