Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Errors while switching from load time weaving to compile time weaving using aspectj

Hi,

Im trying to switch to aspectj compiler for our project which takes a lot of time to weave during load time, so i thought of evaluating compile time weaving using aspectj. Below are the steps I took:

1. Added aspectjweaver to pom- latest stable version
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.10</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.10</version>
</dependency>
2. Added aspectj maven plugin to build
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.10</version>
<configuration>
<showWeaveInfo>true</showWeaveInfo>
<source>1.8</source>
<target>1.8</target>
<Xlint>ignore</Xlint>
<complianceLevel>1.8</complianceLevel>
<encoding>UTF-8</encoding>
<verbose>true</verbose>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
3. Enabled Aspectj mode in JpaRepository
@EnableTransactionManagement(mode= AdviceMode.ASPECTJ)
Now when im compiling my project Im getting some aspectj errors :

-> The parameter (parameter name) is not bound in [all branches of] pointcut
-> use of ProceedingJoinPoint is allowed only on around advice 
For the 2nd error , Ive verified, the advice is around not sure why this error occurs then.

It works perfectly fine when I was using default Spring AOP load time weaving. I tried finding my way out but could not hence posting here. (Saw this blog which lists similar thing but it says it was fixed in version 1.7.2)

I tried doing the same using ajc plugin for my ide (previous observations were using maven command line build). Similar errors occurred.

Any help would be appreciated!

Thanks,
Bhuvan


Back to the top