package service;
import org.springframework.aop.MethodBeforeAdvice;
import java.lang.reflect.Method;
public class MyMethodBeforeAdvice implements MethodBeforeAdvice{
}
在MyMethodBeforeAdvice中出现错误
错误提示:The hierarchy of the type MyMethodBeforeAdvice is inconsistent
可能是接口MethodBeforeAdvice中的父类没有被引入
于是查看源码:spring-aop-4.1.1.RELEASE-sources
public interface MethodBeforeAdvice extends BeforeAdvice
public interface BeforeAdvice extends Advice
Advice的位置在:
import org.aopalliance.aop.Advice;
发现原本自带的Spring框架里面没有这个jar包
http://www.docjar.com/jar_detail/aopalliance-1.0.jar.html
在此网站下载,导入此包即可解决错误