java - Spring AOP 中的错误 "The hierarchy of the type ClassName is inconsistent"

标签 java spring spring-aop

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/

相关文章:

java - 如何读取单击多个相同的 href 以使用 css 使用 findby 元素获取值

java - 如何同步 GUI 元素?

java - JFrame 主题和外观

java - 使用 Spring AOP 清理记录器

Autowiring 的 HTTPServletRequest bean 的 Spring AOP 和方面线程安全

java - 使用 @Configurable 的 Spring Autowiring

java - Vaadin 流 : Difference between Component and Element

spring - 在 Spring 中,为什么 POJO 上的 CGLib 会丢失行号?

java - Hibernate 命名查询不知道错误

java - 在 @Controller 方法上使用 @Before 方面与 Spring 不起作用