Community
Participate
Working Groups
Build Identifier: *Environment* OS name: "linux" version: "2.6.18-164.11.1.el5" arch: "i386" Family: "unix" Apache Maven 2.2.1 Java version: 1.6.0_19 *Related Plugin & Libraries* aspectj-maven-plugin: 1.3 spring-aspects: 3.0.3.RELEASE I've seen that this problem is reported as fixed in 1.6.8 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=309761). However, I still get this error. Any help would be appreciated! Thank you. *Log messages* [INFO] [aspectj:compile {execution: default}] [WARNING] bad version number found in /home/devadmin/.m2/repository/org/aspectj/aspectjrt/1.6.8/aspectjrt-1.6.8.jar expected 1.6.7 found 1.6.8 [ERROR] trouble in: public class com.xxx.service.common.CacheLinkedHashMap extends java.util.LinkedHashMap: private int maxCapacity protected boolean removeEldestEntry(java.util.Map$Entry) org.aspectj.weaver.MethodDeclarationLineNumber: 9:228 : method-execution(boolean com.xxx.service.common.CacheLinkedHashMap.removeEldestEntry(java.util.Map$Entry)) | ALOAD_0 // Lcom/xxx/service/common/CacheLinkedHashMap; this (line 10) | method-call(int com.xxx.service.common.CacheLinkedHashMap.size()) | | INVOKEVIRTUAL com.xxx.service.common.CacheLinkedHashMap.size ()I | method-call(int com.xxx.service.common.CacheLinkedHashMap.size()) | ALOAD_0 // Lcom/xxx/service/common/CacheLinkedHashMap; this | GETFIELD com.xxx.service.common.CacheLinkedHashMap.maxCapacity I | IF_ICMPLE L0 | ICONST_1 | IRETURN | L0: ICONST_0 | IRETURN method-execution(boolean com.xxx.service.common.CacheLinkedHashMap.removeEldestEntry(java.util.Map$Entry)) end protected boolean removeEldestEntry(java.util.Map$Entry) ... ... -- (StackOverflowError) null null java.lang.StackOverflowError at java.util.WeakHashMap.get(WeakHashMap.java:348) at java.util.Collections$SynchronizedMap.get(Collections.java:1975) at org.aspectj.weaver.World$TypeMap.get(World.java:1119) at org.aspectj.weaver.World.resolve(World.java:273) at org.aspectj.weaver.World.resolve(World.java:209) at org.aspectj.weaver.UnresolvedType.resolve(UnresolvedType.java:645) at org.aspectj.weaver.ResolvedType.getRawType(ResolvedType.java:2331) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:427) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:393) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:427) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:393) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:427) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:393) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:427) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:393) at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:427) Reproducible: Sometimes Steps to Reproduce: It's not happening all the time. All I do is using the command "mvn clean package".
The 1.6.8 release notes describe the issue: http://eclipse.org/aspectj/doc/released/README-168.html It is fixed in 1.6.8. *** This bug has been marked as a duplicate of bug 314984 ***
I'm using 1.6.8 but it's still happening. (In reply to comment #1) > The 1.6.8 release notes describe the issue: > > http://eclipse.org/aspectj/doc/released/README-168.html > > It is fixed in 1.6.8. > > *** This bug has been marked as a duplicate of bug 314984 ***
hmmm, can you attach the full log showing it happening with 1.6.8? (You could also try 1.6.9)
I wonder if you only think you're using a later version. See bug 230053. I think I may be in exactly the same boat with my maven config. I'll post back here if I figure it out; the other bug is light on details.
A change like this in my <pluginManagement/> section made the warning (and the error) go away, so presumably I'm now at 1.6.9 for real: @@ -94,6 +94,13 @@ <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.3</version> + <dependencies> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjtools</artifactId> + <version>1.6.9</version> + </dependency> + </dependencies> </plugin> This is necessary because the aspectj-maven-plugin's POM declares this dependency with a version of 1.6.7.
thanks for the tip Matt, I'll remember that.
Thank you All for comments. Unfortunately there is not much more in the full log, other than what I originally posted. There were just repetitive messages of [ERROR] trouble in: public class com.xxx.service.common.CacheLinkedHashMap extends java.util.LinkedHashMap: private int maxCapacity protected boolean removeEldestEntry(java.util.Map$Entry) org.aspectj.weaver.MethodDeclarationLineNumber: 9:228 it kept going on for many many classes.. and at the end, there were just StackOverflowError messages. I'm pretty sure that I'm on AspectJ 1.6.8. My pom explicitly specifies aspectj version. <properties> <aspectj.version>1.6.8</aspectj.version> ... </properties> ... <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>${aspectj.version}</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>${aspectj.version}</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId> <version>${aspectj.version}</version> </dependency> ... And for the aspectj maven plugin, I do not have <pluginManagement>; I only have the plugin configuration. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <configuration> <complianceLevel>1.6</complianceLevel> <aspectLibraries> <aspectLibrary> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> </aspectLibrary> </aspectLibraries> </configuration> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> Right now, I rolled back to 1.6.6 to avoid the error. I'll try 1.6.9 with Matt's suggestion. Thanks again!
Under bug 323417 we found another way to cause this exception. The fix is now in the latest build snapshots. If you wanted to try it, you will need this maven repo: <repository> <id>maven.springframework.org</id> <name>SpringSource snapshots</name> <url>http://maven.springframework.org/snapshot</url> </repository> and to depend on AspectJ version of aspectjtools/weaver/runtime: 1.6.10.BUILD-SNAPSHOT