环境:spring3.1.3; jdk:1.6
在使用AOP时,继承MethodBeforeAdvice时,已经加载spring.jar并且命名空间也正确引用,但是还是提示错误:The hierarchy of the type GreetingBeforeAdvice is inconsistent。GreetingBeforeAdvice 为定义的实现类。
解决方案:
导入aopalliance-1.0.jar包(当前环境是该版本,其他版本未测试是否兼容);
原因:MethodBeforeAdvice的父类不在org.springframework.aop中
aopalliance-1.0.jar下载地址: http://download.csdn.net/detail/yanghanxiu/8492165