Even after adding all Spring 3.1 jar i was getting excpetion as below :
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException:
Caused by: java.lang.ClassNotFoundException: org.aopalliance.aop.Advice
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 49 more
Solution :
As part of https://jira.springsource.org/browse/SPR-2011, Removed AOP Alliance interfaces from spring-aop.jar and
the aopalliance.jar needs to be added explicitly. Instead of using jar from any other sources, it's better to use jar from official maven repository.
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException:
Caused by: java.lang.ClassNotFoundException: org.aopalliance.aop.Advice
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 49 more
Solution :
As part of https://jira.springsource.org/browse/SPR-2011, Removed AOP Alliance interfaces from spring-aop.jar and
the aopalliance.jar needs to be added explicitly. Instead of using jar from any other sources, it's better to use jar from official maven repository.