Michael,
if you use <tx:annotation-driven mode="aspectj"/> then AJ takes over handling the @Transactional annotations in your code.
You must configure aspectj in your pom to do the class file weaving.
Like so then it works.
Code:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.2</version>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.12</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.12</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<outxml>true</outxml>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
You could also configure load-time weaving for your spring context and your app:
Code:
<context:load-time-weaver aspectj-weaving="autodetect"/>
start the JVM with -javaagent:org.springframework.instrument.jar
As your test dirties the database it is sensible to add this to your test-class. Otherwise you have to cleanup the db in the @Before method yourself, so the ctx is re-instantiated for every run.
Code:
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
I also attach the file with the diff to your repo.
diff.txt