Community
Participate
Working Groups
The following happens when compiling with 1.6.10. Referred Spring version is 3.0.3 Severity set as Major, as it breaks this build (although thankfully it's 'only' our enforce-policies nightly). [ERROR] Internal compiler error java.lang.RuntimeException: Problem processing attributes in org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.class at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:383) at org.aspectj.weaver.bcel.BcelObjectType.<init>(BcelObjectType.java:160) at org.aspectj.weaver.bcel.BcelWorld.buildBcelDelegate(BcelWorld.java:382) at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:377) at org.aspectj.weaver.World.resolveToReferenceType(World.java:452) at org.aspectj.weaver.World.resolve(World.java:298) at org.aspectj.weaver.World.resolve(World.java:211) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.fromEclipse(EclipseFactory.java:148) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:647) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:636) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.createBinaryTypeFrom(AjLookupEnvironment.java:1346) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:599) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:276) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:139) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:178) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:451) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(CompilationUnitScope.java:505) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(CompilationUnitScope.java:361) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:430) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:629) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:392) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:1022) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:268) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112) at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60) at org.aspectj.tools.ajc.Main.run(Main.java:363) at org.aspectj.tools.ajc.Main.runMain(Main.java:240) at org.codehaus.mojo.aspectj.AbstractAjcCompiler.execute(AbstractAjcCompiler.java:381) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at hudson.maven.agent.Main.launch(Main.java:165) at hudson.maven.MavenBuilder.call(MavenBuilder.java:165) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:694) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:638) at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:686) at org.aspectj.weaver.UnresolvedType.forSignature(UnresolvedType.java:416) at org.aspectj.weaver.UnresolvedType.read(UnresolvedType.java:847) at org.aspectj.weaver.WeaverStateInfo.read(WeaverStateInfo.java:142) at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:105) at org.aspectj.weaver.bcel.Utility.readAjAttributes(Utility.java:101) at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:379)
Created attachment 185694 [details] ajcore dump
I don't know why, but I'm having real trouble recreating this problem. I have 1.6.10, I have spring-aspects-3.0.3.RELEASE.jar. The index of out bounds exception indicates there is a typename with 0 length in the jar. Of course, I am making an assumption that it is getting the AnnotationBeanConfigurerAspect from the spring-aspects jar, but it should be.
Although I couldn't recreate this issue, I have uncovered an error with attribute serialization whilst working on another bug, which *could* be related. This is fixed in the latest dev build: http://eclipse.org/aspectj/downloads.php If you have a moment, I'd be really interested in you trying out the failing scenario with that weaver. thanks. If you don't have time to grab a jar and try it, I'll probably be putting a 1.6.11.M2 out shortly with the change in it.
Thanks Andy. I'll give the dev build a go next week when I'm back (from skiing :-)
Back, but gonna wait for the milestone as rather pushed for time.
can you attach an updated stack trace with 1.6.11.m2, in case it is subtly different.
Created attachment 189782 [details] 1.6.11.M2 stack dump
unsetting the target field which is currently set for something already released
Andy, As I've not seen this since, I think it would make sense to close as "works for me". I don't even know what codebase it was that generated that issue now.
I'm not sure this is the same bug, though the stacktrace looks quite similar. Using AspectJ 1.8.1, Java 8. I get the following exception when class having this method public String getString() { Optional<String> dummy = Optional.of("Just a dummy optional"); return dummy.orElseThrow(() -> { return new RuntimeException(); }); } is woven: [AppClassLoader@58644d46] abort trouble in: public class com.foo.Bar extends java.lang.Object: // Bytecode of the class Aug 19, 2014 4:28:51 PM org.aspectj.weaver.tools.Jdk14Trace error SEVERE: com/inthergroup/aspect/retry/config/Parser java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:646) at org.aspectj.weaver.UnresolvedType.forSignature(UnresolvedType.java:383) While this works fine : public String getString() { Optional<String> dummy = Optional.of("Just a dummy optional"); return dummy.orElseThrow(RuntimeException::new); }
Hey Dan, I'm trying to recreate that without much luck, I wrapped up your snippet with an aspect but I can't make it fail (at AspectJ 1.8.0/1.8.1 or 1.8.2): === Code.java === import java.util.*; public class Code { public String getString() { Optional<String> dummy = Optional.of("Just a dummy optional"); return dummy.orElseThrow(() -> { return new RuntimeException(); }); } } aspect X { before(): within(!X) {System.out.println(thisJoinPoint);} } === Can you distill it into a small failing example? I'm not sure what kind of advice or pointcut you are having trouble with.
Hi Andrew, The preceding example is not a part of an aspect source code : this is a simple class; I don't have any aspect matching this class - theoretically it should remain untouched. The only one thing - Code.java class belongs to a package configured to be scanned in the aop.xml. <aspectj> <weaver options="-showWeaveInfo -Xset:overWeaving=true"> <include within="com.package.where.the.class.is..*" /> </weaver> <aspects> </aspects> AspectJ produces that error in output during the loadtime weaving, while compilation using aspectj-maven-plugin doesn't have issues. After error is printed, it skips this class and moves forward. I think it happens when AspectJ attempts to parse bytecode of that class, and guess this logic doesn't depend on aspects defined. If I'm mistaken and what type of pointcuts/advices we have matters, let me know (I will have a look into sources, haven't seen them yet).
Is there any chance you could share with me (privately?) the compiled class in question so I can take a look at the bytecode?