This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Downloaded spring-framework-3.1.0.RC1 and trying to create a simple aop based program.
Please see spring configuration file Application.xml
As mentioned in configuration file, I am using POJO based aspect, but while running my sample program I am facing below exception
i am wondering why this class is not present in spring 3.1. On web I was suggested to add 'aopalliance-1.0.jar'. I add this but after that I got below exception and was suggested to add - aspectjweaver.jar.
I am not sure why spring is asking me to include aspectj jars. Even though I am using POJO base aop. looks like there is an internal dependencies. If I am downloading the complete package of spring then all the libraries must be present in that.
Because Spring AOP is based on AspectJ AOP project, and therefore some of the classes and stuff are defined by AspectJ and not in Spring. So you have to include some AspectJ jar files. Basically Spring is using some 3rd party classes to implement Spring AOP and they come from AspectJ.
Hope that helps clear things up for you.
I also recommend doing Spring AOP with Annotations, it is much simpler to configure than the xml stuff you are doing. (You still need the AspectJ jars)
So even I am using POJO base AOP, I need AspectJ and associated jar.
I am not sure who can answer it - Why spring library does not include the dependent jars?
Not sure what you mean by POJO base AOP, as for me all my Aspect classes are POJOs, actually all my classes are POJOs.
Spring AOP is a subset of AspectJ and requires some AspectJ jars in the classpath.