The hierarchy of the type is inconsistent错误问题

时间:2024-06-27 09:37:20

在springMVC的AOP 面向切面编程中,引用:

package com.ah.aop;

import java.lang.reflect.Method;

import org.springframework.aop.MethodBeforeAdvice;

public class MyMethodBeforeAdvice implements MethodBeforeAdvice {

@Override
    public void before(Method arg0, Object[] arg1, Object arg2)
            throws Throwable {
        // TODO Auto-generated method stub

}

};

在实现前置通知接口MethodBeforeAdvice时候,出现The hierarchy of the type is inconsistent  解释为:层次结构的类型不一致;

可能的原因:自己的类继承于某个类,这个类或者这个类继承的类或者再往上继承的某个类所在的jar包没有被引入。