今天使用spring aop得时候遇到下面这个错误,后面折腾了2小时才发现原理是jar包差了一个。
Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
缺少的jar是aopalliance-1.0.jar,直接在https://zhidao.baidu.com/share/04177054e180d09e3998808efa0401c7.html这个页面下载即可。或者其他地方下载。导入进去再add 头 build path就ok了