The type org.aopalliance.aop.Advice cannot be resolved. It is indirectly referen

今天学习spring AOP,在实现AfterReturningAdvice 这个接口时 代码如下:
public class LogInterceptor implements AfterReturningAdvice{

public void afterReturning(Object arg0, Method arg1, Object[] arg2,
Object arg3) throws Throwable {


}
报这个错误:The type org.aopalliance.aop.Advice cannot be resolved. It is indirectly referen
找了半天资料才解决。郁闷死!!
解决方法如下:导入spring.jar(下带的org.aopalliance.*),因为Spring的aop的实现遵守了AOP联盟的约定,也就是它的advice都实现了org.aopalliance.aop.Advice接口。

你可能感兴趣的:(spring,AOP)