1. 程式人生 > >spring AOP使用中Error creating bean with name ‘…’defined in class path resource..問題及其解決方法

spring AOP使用中Error creating bean with name ‘…’defined in class path resource..問題及其解決方法

factory fail 正常 ins aspect 工作內容 thread def before

spring AOP使用中Error creating bean with name ‘…’defined in class path resource..問題及其解決方法

2018/3/24 異常小記

工作環境:myeclipse2015(jar與java compiler 版本一致)、windows10

工作內容:spring 中AOP的使用測試

異常信息:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘AuthBeforeAdvice‘ defined in class path resource [applicationContext2.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException

: Error creating bean with name ‘org.springframework.aop.aspectj.AspectJPointcutAdvisor#0‘: Cannot create inner bean ‘(inner bean)#19f3736‘ of type [org.springframework.aop.aspectj.AspectJMethodBeforeAdvice] while setting constructor argument; nested exception is

。。。。。。

異常原因:aspectjweaver.jar 版本沖突,導致無法正常引用。

異常前用戶庫:

技術分享圖片

解決方法:更換新版本的jar包

aspectjweaver-1.6.1.jar下載地址:

http://www.java2s.com/Code/Jar/a/Downloadaspectjweaver172jar.htm

技術分享圖片

snail 原創,歡迎轉載,轉載請註明出處。歡迎留言交流,期待共同進步。

QQ:185466981

spring AOP使用中Error creating bean with name ‘…’defined in class path resource..問題及其解決方法