Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.aspectj.lang.NoAspectBoundException - method <init>()V not found

I had same problem as vanhre asked in Spring forum, but in my case I couldn't change the constructor.

I'm using Spring java configuration, so it was initializing ok during jetty start, but in runtime, when I executed the functionality with my aspect it failed with exactly the same exception from the forum.

like image 348
Betlista Avatar asked Jun 12 '26 06:06

Betlista


1 Answers

I found later, that I need aspectjrt dependency in my pom.

<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjrt</artifactId>
    <version>1.6.12</version>
</dependency>

edit: Missing dependency was an error, but real problem is Eclipse + aspects combination. When I used Eclipse to build my aspect class this error occurred. Additionally when I compiled class the aspect advice was for, aspect was not called.

solution: you have to use maven to build your application (I'd be glad if someone find solution for Eclipse, because I'm sure I'll forget this)

like image 194
Betlista Avatar answered Jun 14 '26 19:06

Betlista



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!