package com.nit.aop.advices;
import java.lang.reflect.Method;
import org.springframework.aop.MethodBeforeAdvice;
public class LoggingBeforeAdvice implements MethodBeforeAdvice
{
@Override
public void before(Method arg0, Object[] arg1, Object arg2)
throws Throwable {
// TODO Auto-generated method stub
}
}
当我执行这个程序时,我收到错误 -“类型 ClassName 的层次结构不一致”,所以现在我想删除这个错误
最佳答案
如果你写的类A继承B,B继承C,比如水果或者C接口(interface),c引用的jar不是你的包,他们报了这个信息,你就可以导入这个jar包了。 这段程序中的代码是Me thodBeforeAdvice,父类不是org.springframework.aop,需要将aopalliance-1.0.jar包导入到你的项目中。
从http://mvnrepository.com/artifact/aopalliance/aopalliance/1.0下载
从这个 Jar 文件中我可以正确运行程序......
关于java - Spring AOP 中的错误 "The hierarchy of the type ClassName is inconsistent",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17552543/