Bug 570691 - AspectJ Internal Error: unable to add stackmap attributes. null
Summary: AspectJ Internal Error: unable to add stackmap attributes. null
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-27 10:54 EST by Rafal Aksamit CLA
Modified: 2021-06-08 07:17 EDT (History)
1 user (show)

See Also:


Attachments
exception (3.29 KB, text/plain)
2021-01-27 10:54 EST, Rafal Aksamit CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal Aksamit CLA 2021-01-27 10:54:03 EST
Created attachment 285399 [details]
exception

Hi,

I'm new to AspectJ so apologies if this is a very simple mistake on my part.

Basically I have a Spring Boot application and I've been trying to add some Load-Time weaving. I started with a single class in my application but my ultimate goal is to add some debugging aspect to a 3rd party code (where I presume I can't add compile-time aspects).

I already have aspectj version (via spring dependencies) on my classpath:

      <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.9.6</version>
      </dependency>

I added following to VM arguments: -javaagent:c:\Users\Rafal\.m2\repository\org\aspectj\aspectjweaver\1.9.6\aspectjweaver-1.9.6.jar 

I also added META-INF/aop.xml which references my test aspect.

So far all good i.e. I can see my aspect configuration being picked up and woven (via AspectJ -showWeaveInfo option) into my class.

However when I ran my project (from Eclipse) I noticed a strange thing in that my application seemed to silently and abruptly end at a method where my aspect was being applied. When I ran the same project in "debug" mode there's an error printed on the console (full exception text attached):

AspectJ Internal Error: unable to add stackmap attributes. null
java.lang.IllegalArgumentException

I'm using following Java version:

C:\Users\Rafal>java --version
openjdk 11.0.5 2019-10-15 LTS
OpenJDK Runtime Environment Zulu11.35+18-SA (build 11.0.5+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.35+18-SA (build 11.0.5+10-LTS, mixed mode)

I found references to this exception but not sure if it is due to incorrect aspectj version being used?

I'd appreciate any pointers.
Comment 1 Alexander Kriegisch CLA 2021-06-08 07:17:43 EDT
If you would please publish a minimal, but complete reproducer project on GitHub, I would like to take a look.