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
< tx:annotation-driven transaction-manager="transactionManager" />
When we thought everything would work, we were surprised to see that on deployment, tomcat reported:
java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
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!
Langganan:
Posting Komentar (Atom)
1 komentar:
interesting article you have indeed cover the topic with great details. I have also documented my experience as 3 ways to resolve NoClassDefFoundError in Java
. let me know if you find it useful.
Posting Komentar