I have a pretty complex web-application where the whole DAO has been outsourced to an @Aspect class which will load database entities whenever methods are accessed which need those.
This whole approach is working wonderfully when the web app is launched from netbeans. However, when I try to deploy the same .war to a standalone tomcat (same version of tomcat, same version of java), I get the following exception upon startup:
Caused by: java.lang.IllegalArgumentException: Advice precedence circularity error
And I just can’t figure out what is causing the problem and why the application runs fine when starting through netbeans.
Maven config:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<fork>false</fork>
<meminitial>256m</meminitial>
<maxmem>768m</maxmem>
<source>1.6</source>
<target>1.6</target>
<encoding>${project.build.sourceEncoding}</encoding>
<showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation>
<debug>true</debug>
<debuglevel>lines,vars,source</debuglevel>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<webXml>src\main\webapp\WEB-INF\web.xml</webXml>
</configuration>
</plugin>
Spring: 3.1.0.RELEASE:
<context:annotation-config />
<context:component-scan base-package="my.package" />
<mvc:annotation-driven />
<mvc:resources mapping="/resources/**" location="/resources/" />
<aop:aspectj-autoproxy />
Java version:
java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
I honestly don’t know what info I should include in this post as I don’t even know where to start… Feel free to ask for more information if needed.
This isn’t necessarily a complete answer but the links should be helpful:
It sounds as if the difference here is that your machines are returning the order of declared methods, of a particular class, differently, which changes how Aspect advices are run:
There is also a Spring ticket for an issue that sounds very similar to yours:
SPR-5314
Hope that’s a little helpful. Good luck.