When you use ASPECTJ annotations to develop an AOP application, you encounter the following issues:: 0 can ' t ' find referenced pointcut the problem, which is actually related to your development environment, such as the following table
JDK version |
Spring version |
ASPECTJRT version and Aspectjweaver version |
1.6 |
3.0 + |
aspectjrt-1.6.2 and aspectjweaver-1.6.2 |
1.7 |
3.0 + |
aspectjrt-1.7.3 and aspectjweaver-1.7.3 |
When the environment is:
JDK 1.7, spring version is 3.0+, if you use aspectjrt-1.6.2 and aspectjweaver-1.6.2 This version, the above error occurs, the ASPECTJ and aspectjweaver version is changed to 1.7.3 or more, the problem is resolved.
Test steps:
1. Change the ASPECTJ and Aspectjweaver version to 1.6.2 and run the result:
<dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupid>org.aspectj& lt;/groupid> <artifactId>aspectjweaver</artifactId> <version>1.6.2</version> &L T;/dependency>
Result:
2. Change AspectJ and Aspectjweaver to 1.7.3 + run result is normal.
<dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.7.3</version> </dependency> <dependency> <groupid>org.aspectj& lt;/groupid> <artifactId>aspectjweaver</artifactId> <version>1.7.3</version> &L T;/dependency>
AspectJ Error:: 0 can ' t find referenced pointcut resolution