Bug 320435 - org.aspectj.weaver.BCException: malformed org.aspectj.weaver.EffectiveSignature attribute
Summary: org.aspectj.weaver.BCException: malformed org.aspectj.weaver.EffectiveSignatu...
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: 1.6.9   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 15:25 EDT by Alex Porras CLA
Modified: 2010-11-08 12:47 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Porras CLA 2010-07-20 15:25:47 EDT
Build Identifier: 20100617-1415


When building my project, I get the following error when adding a dependent jar to the AspectJ "Aspect Path".

org.aspectj.weaver.BCException: malformed org.aspectj.weaver.EffectiveSignature attribute (length:117)java.io.EOFException

when batch building with classpath: /home/alex/my_project/classes:/opt/java/jdk1.6.0_20/jre/lib/resources.jar:/opt/java/jdk1.6.0_20/jre/lib/rt.jar:/opt/java/jdk1.6.0_20/jre/lib/jsse.jar:/opt/java/jdk1.6.0_20/jre/lib/jce.jar:/opt/java/jdk1.6.0_20/jre/lib/charsets.jar:/opt/java/jdk1.6.0_20/jre/lib/ext/localedata.jar:/opt/java/jdk1.6.0_20/jre/lib/ext/sunpkcs11.jar:/opt/java/jdk1.6.0_20/jre/lib/ext/dnsns.jar:/opt/java/jdk1.6.0_20/jre/lib/ext/sunjce_provider.jar:/my/lib/folder/server/j2ee-1.4.jar:/my/lib/folder/server/commons-discovery-0.2.jar:/my/lib/folder/server/commons-logging-1.1.1.jar:/my/lib/folder/server/apache-soap-2.3.1.jar:/my/lib/folder/server/activation-1.0.2.jar:/my/lib/folder/server/axis-1.4.2.jar:/my/lib/folder/server/mail-1.3.1.jar:/my/lib/folder/server/ojdbc14-10.2.0.4.0.jar:/my/lib/folder/server/iText-1.3.jar:/my/lib/folder/server/junit-4.7.jar:/my/lib/folder/server/xstream-1.3.1.jar:/my/lib/folder/server/wsdl4j-1.6.2.jar:/my/lib/folder/server/dbunit-2.2.jar:/my/lib/folder/server/hsqldb-1.8.0.jar:/my/lib/folder/server/log4j-1.2.8.jar:/home/alex/eclipse/workspace/org.aspectj.runtime/aspectjrt.jar:/eclipse/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar:

	at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:139)
	at org.aspectj.weaver.bcel.Utility.readAjAttributes(Utility.java:101)
	at org.aspectj.weaver.bcel.BcelMethod.unpackAjAttributes(BcelMethod.java:184)
	at org.aspectj.weaver.bcel.BcelMethod.<init>(BcelMethod.java:91)
	at org.aspectj.weaver.bcel.BcelObjectType.getDeclaredMethods(BcelObjectType.java:289)
	at org.aspectj.weaver.ReferenceType.getDeclaredMethods(ReferenceType.java:770)
	at org.aspectj.weaver.ResolvedType.getDeclaredAdvice(ResolvedType.java:947)
	at org.aspectj.weaver.ResolvedType.getDeclaredShadowMungers(ResolvedType.java:987)
	at org.aspectj.weaver.ResolvedType.collectShadowMungers(ResolvedType.java:822)
	at org.aspectj.weaver.ResolvedType.collectCrosscuttingMembers(ResolvedType.java:749)
	at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect(CrosscuttingMembersSet.java:85)
	at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect(CrosscuttingMembersSet.java:69)
	at org.aspectj.weaver.bcel.BcelWeaver.addLibraryJarFile(BcelWeaver.java:245)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:862)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:245)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181)
	at org.aspectj.ajde.core.internal.AjdeCoreBuildManager.performBuild(AjdeCoreBuildManager.java:105)
	at org.aspectj.ajde.core.AjCompiler.buildFresh(AjCompiler.java:97)
	at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:243)/hom

Reproducible: Always

Steps to Reproduce:
1. Create project
2. Have at least one dependency be in the AspectJ "Aspect Path"
3. Build the project
Comment 1 Alex Porras CLA 2010-07-20 15:32:38 EDT
I realize that this is a bit difficult because this happens with a project I cannot provide here.  However, I have downloaded the source code to ADJT and will be glad to debug eclipse itself to provide more details.

So far, I have debugged Eclipse a little and can say that this is where the EOF occurrs:

1. This class is called by EffectiveSignatureAttribute's constructor:

public static ResolvedMemberImpl readResolvedMember(VersionedDataInputStream s, ISourceContext sourceContext) throws IOException {

2. The above class calls this:

UnresolvedType declaringType = compressed ? UnresolvedType.forSignature(s.readUtf8(s.readShort())) : UnresolvedType.read(s);

The "compressed" boolean is false, so UnresolvedType.read(s) is called, where "s" is an instance of VersionedDataInputStream.


3. The UnresolvedType.read call is where the EOF happens.
Comment 2 Alex Porras CLA 2010-07-20 15:34:31 EDT
ADJT Version: 2.1.0.e36x-release-20100630-1500
AspectJ version: 1.6.9.20100629172100
Comment 3 Andrew Clement CLA 2010-07-20 15:46:26 EDT
i think compressed ought to be true if working at the 1.6.9 or later level.

What level of aspectj was used to build the jar you have placed on the aspectpath?

Upgrading your AJDT will affect the situation (but I can't promise it will fix it).
Comment 4 Alex Porras CLA 2010-07-20 16:11:22 EDT
Hi Andy,

Thanks for looking into this for me.

I am not 100% sure, but I believe the jar file with the aspect was built with aspectj 1.6.3.

What does the compressed value represent?  Perhaps I can try and find out why it is false when it should be true.

As far as upgrading AJDT on my eclipse, do you mean trying the development release? 

Cheers,

Alex
Comment 5 Andrew Clement CLA 2010-07-20 17:05:10 EDT
yes, i would mean trying out the development release.

If it is built with 1.6.3 that would explain why compressed is false as compression is 'new' with 1.6.9.  compression indicates strings are recorded by index references into the constant pool rather than complete strings.  This drastically reduces the size of aspectj class files.  The reading code should only be attempting to deal with compression if the class file it encounters was built with a version of 1.6.9 or higher.  The VersionedDataInputStream carries a major version indicating the AspectJ bytecode version used to build the input data, so reader code can make decisions about how it was packed.  If it was built with 1.6.3 the version number should be 6 which (as defined in WeaverVersionInfo) was the current version until things changes to 7 in AspectJ 1.6.9.

(If you rebuild your aspectpath jar with 1.6.9 that may also get you past the problem.)
Comment 6 Julien HENRY CLA 2010-09-10 11:01:52 EDT
I have the same issue. The library I am referring to in "Aspect Path" was built using AspectJ RT 1.6.7.

Here is the error:
org.aspectj.weaver.BCException: malformed org.aspectj.weaver.EffectiveSignature attribute (length:190)java.io.EOFException
when batch building with classpath: XXXXXXXXXX


	at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:139)
	at org.aspectj.weaver.bcel.Utility.readAjAttributes(Utility.java:101)
	at org.aspectj.weaver.bcel.BcelMethod.unpackAjAttributes(BcelMethod.java:185)
	at org.aspectj.weaver.bcel.BcelMethod.<init>(BcelMethod.java:91)
	at org.aspectj.weaver.bcel.BcelObjectType.getDeclaredMethods(BcelObjectType.java:289)
	at org.aspectj.weaver.ReferenceType.getDeclaredMethods(ReferenceType.java:770)
	at org.aspectj.weaver.ResolvedType.getDeclaredAdvice(ResolvedType.java:947)
	at org.aspectj.weaver.ResolvedType.getDeclaredShadowMungers(ResolvedType.java:987)
	at org.aspectj.weaver.ResolvedType.collectShadowMungers(ResolvedType.java:822)
	at org.aspectj.weaver.ResolvedType.collectCrosscuttingMembers(ResolvedType.java:749)
	at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect(CrosscuttingMembersSet.java:85)
	at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect(CrosscuttingMembersSet.java:69)
	at org.aspectj.weaver.bcel.BcelWeaver.addLibraryJarFile(BcelWeaver.java:244)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:862)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:245)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181)
	at org.aspectj.ajde.core.internal.AjdeCoreBuildManager.performBuild(AjdeCoreBuildManager.java:105)
	at org.aspectj.ajde.core.AjCompiler.buildFresh(AjCompiler.java:97)
	at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:243)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

It was failing with stable version and also with dev version :   AspectJ Development Tools	2.1.1.e35x-20100903-1400
Comment 7 Mattias Jiderhamn CLA 2010-11-08 04:08:17 EST
I'm seeing the same problem when trying to upgrade the IntelliJ plugin to AspectJ 1.6.10
Comment 8 Andrew Clement CLA 2010-11-08 12:34:57 EST
To debug this situation further, I'll need to have a jar that shows the failure.  If anyone has one they can share, please email it to me.
Comment 9 Alex Porras CLA 2010-11-08 12:47:14 EST
Hi Andy,

Thanks for the update.  I've since upgraded eclipse and am on a project that does not require aspectj.  I tried to go back and reproduce the problem, but of course, now I cannot seem to, as Murphy's Law would have it.

If I am able to get the error again, I will post the jar file.

Cheers,

Alex