我想写一个拦截器,
package com.demo.spring.aop;
import org.springframework.aop.MethodBeforeAdvice;
import java.lang.reflect.Method;
public class LoggingInterceptor implements MethodBeforeAdvice {
public void before(Method method, Object[] objects, Object o) throws Throwable {
}
}
但是它却提示The hierarchy of the type LoggingInterceptor is inconsistent
这是什么回事啊?
查了一下,aopalline.jar 在扩展文件夹dependences 里
大哥,为了你老人家我特意自己试的,你报的编译错误而不是异常吧
试一下要是没问题把分结了
应该是缺少必要jar,以前遇到过
代码上看不出什么问题,你关闭你的IDE,重新打开看看。
引入commons-logging.jar
在eclipse 里,把包重新引入一遍,包括jdk。 编译完运行一下看看是不是会运行起来
These errors happend because some interface/class in the hierarchy cannot be resolve.
For example: the error is occur in your class - class x, x inherits y, and in turn, y inherits z. However, the compiler
cannot resolve z (in above error is EventManager), because z is belong to a library that is not included.
Therefore, you have to add package containing z to the classpath/ or project's Java Build Path (if you are using eclipse).
这么一大段是从谷歌搜到的, 意思是,你的程序依赖了某些类,但是某个类又依赖了其他的你并没有引入的类,建议你重新再eclipse中build一下所有的lib
查了一下,aopalline.jar 在扩展文件夹dependences 里
就是缺少了必要jar包,要是真找起来还真没有什么办法具体定位到某个jar