天天看點

Spring Aop 異常

      Exception in thread "main" org.springframework.beans.factory.BeanCreationException: 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

 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean

     用Spring3.0.3做測試aop用例時遇到的異常(由于Spring3.0并沒有提供aspect相關的jar,于是使用Spring2.0的aspect包),看了N多的網頁說是要換成Spring 2.0.8或Spring 2.5.6 aspect包,結果一試還是出異常,最後沒辦法一個一個jar包添加進去才發現是少了aopalliance.jar包。

繼續閱讀