I created a spring roo project (1.1.5.RELEASE [rev d3a68c3] ) using the following example on WinXp (java version "1.6.0_16").
C:\springROO\InstallScripts>type TestAspectJ.roo
project --topLevelPackage spring.roo.test
persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
entity --class ~.domain.Person
field string --fieldName name --class ~.domain.Person
controller all --package ~.web
perform eclipse
perform package
exit
I was able to deploy the war file that was produced using the above example roo file successfully in tomcat 6.0.26. Next, I created an example java program using STS IDE to test aspectj like this:
@Aspect
public class AspectSupport {
@Pointcut("execution(* spring.roo.test.*(..))")
public void testPointCut() {}
@Around("testPointCut()")
public void testAround(ProceedingJoinPoint joinPoint) throws Throwable {
System.out.println("AspectSupport.testAround - before: ");
joinPoint.proceed();
System.out.println("AspectSupport.testAround - after: ");
}
}
I added <aop:aspectj-autoproxy /> to webmvc-config.xml file. Content of all these three files are attached to this thread. I was able to rebuild, redeploy and test the spring roo app in tomcat 6.0.26 successfully.
Question: The string AspectSupport did not appear in the log file. It looks like testAround never got executed. What do I need to do so that testAround method will get called when I test the spring roo app?