Spring 3.0 is emphatically remarkable! When we moved to Spring 3.0, everything worked fine and the team was of course happy! While doing this, we were also trying to move transactions from the old-school way (using hibernate.cfg.xml) to autowiring session factory and making it annotation driven! The latter move forced us to introduce the following code in out applicationContext.xml
When we thought everything would work, we were surprised to see that on deployment, tomcat reported:
While this Resolve java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor kept us in surprise, I had to google around a bit! On searching a bit across the Internet, I came across the following solution
Solution:
The previous versions of Spring (<3.0)were shipping AOPAlliance.jar which was required to run the above annotation. In spring 3.0 however, does not come bundles with this jar. As such, if you use Spring 3.0, it is important that you download this jar from this link
Yet another utile pointer that I came across is the fact that there is a JIRA issue to include the AOPAlliance.jar in future releases of Spring! Once I added this jar to the classpath of my application, the Resolve java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor error disappeared!
If you find the information pretty helpful, I would really be happy if you would keep me posted via the comments form displayed under this article! If you had wanted some other information related to the same topic, I would suggest you to drop a note to me using the comments form for that would help me in getting back to you with the details you are in need of!
<tx:annotation-driven transaction-manager="transactionManager" />
When we thought everything would work, we were surprised to see that on deployment, tomcat reported:
<br />java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor<br />
While this Resolve java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor kept us in surprise, I had to google around a bit! On searching a bit across the Internet, I came across the following solution
Solution:
The previous versions of Spring (<3.0)were shipping AOPAlliance.jar which was required to run the above annotation. In spring 3.0 however, does not come bundles with this jar. As such, if you use Spring 3.0, it is important that you download this jar from this link
Yet another utile pointer that I came across is the fact that there is a JIRA issue to include the AOPAlliance.jar in future releases of Spring! Once I added this jar to the classpath of my application, the Resolve java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor error disappeared!
If you find the information pretty helpful, I would really be happy if you would keep me posted via the comments form displayed under this article! If you had wanted some other information related to the same topic, I would suggest you to drop a note to me using the comments form for that would help me in getting back to you with the details you are in need of!
Thanks,
ReplyDeleteCame across the same problem. For others having the same problem please note that the jar, com.springsource.org.aopalliance-1.0.0.jar, is now included in spring-framework-3.0.2.RELEASE-dependencies.zip.
Cheers
@Anonymous
ReplyDeleteThanks for that pointer! Nice of you to have made us all know about it here!
any idea if it is present spring-framework-3.0.3? I got same exception when we moved to 3.0.3
ReplyDelete@Anonymous
ReplyDeleteCan you please check if the com.springsource.org.aopalliance-1.0.0.jar is present in your classpath and further let us know in this blog here?
Hello, I'm into the same problem. I use Spring 3.0.3 and I dont find aopalliance.jar bundled with it. Should I get it from Spring 3.0.2 dependencies jar?
ReplyDelete@Anonymous
ReplyDeleteYou can download this jar file from the link below: Let me know if you need more help in this regard!
http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.org.aopalliance&version=1.0.0
thank you verry much man
ReplyDeleteThat is very nice to hear that this helped you!
ReplyDeleteCheers for that, I ran into the same problem..no idea why aopalliance was removed from Spring 3 in the first place!
ReplyDeleteI could build but not deployed. Glassfish has kept throwing the same exception. If you don't mind, where exactly did you make the modification(s), please?
ReplyDeleteMuchas gracias viejo
ReplyDeleteThanks for that feedback!
ReplyDeletethank for your post, it help me to solve above problem. :)
ReplyDeleteTHANK YOU! You saved me ... I had very similar problem when deployng our Spring 3.0.5-based app. to WebLogic 10 server. I included aopalliance.jar, and it solved the exception.
ReplyDeleteThanks for the info. Landed directly here from google :)
ReplyDelete@tienlong, @PaniniLuncher,@Suresh
ReplyDeleteAwesome. Thanks for your feedback
Thanks, it works. :)
ReplyDeleteDead on !! Thanks for your help !!
ReplyDeleteHey thank you very much for sharing the solution.
ReplyDeleteI had to use Spring 3.0.5, which as of today is the latest release, and I do get this error, so I suppose the jar isn't included.
Thanks for the timesaver!
Tanya
Oh yeah, that was it... Thanks a bunch! :)
ReplyDeleteThnx a lot :-) did not need to google a lot for it thnx to ur post :))
ReplyDeletewarm regards
Vinod M
You may need cgLib2 to make it work:
ReplyDeletehttp://sourceforge.net/projects/cglib/files/
Yes thank you think that did it for me as well, on GlassfishESBv2.2
ReplyDeleteAwesome article!
ReplyDeleteWow best post. Thanks, it works for me!
ReplyDeleteThanks :)
ReplyDeleteThaks!
ReplyDeletethanks a lot, you helped me solve the problem with spring 3.0.6!
ReplyDeleteGonzalo
Thank you very much for this post. This helped me a lot since I'm new to spring.
ReplyDeleteI got the same error. Thanks for your post!
ReplyDeleteThank you for posting the solution. I had the same issues in Spring 3.1.1! How come Spring's documentation doesn't refer to this !!!
ReplyDeleteAwesome! Thanks.
ReplyDeletehello, thank you for this post, but, after adding this jar, this error is persisting :( in my spring file,any help??
ReplyDeleteHi thank you for the post, but after adding the jar, the error persists in my spring file, and I can not use the annotations :( , please help !
ReplyDeleteThanks, i included the jar but the error persists :'(
ReplyDeleteTHanks but sadly it didn't work for me :(
ReplyDeleteAwsome thank you very much for this information!!
ReplyDeleteThanks for you help, this info saved my graduation project :)
ReplyDeletethank you ...yaar saved a day
ReplyDelete