Caused by: java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut
解决方法:
1,版本问题。查看你的版本。我的是JDK1.7对应的jar包为aspectjweaver-1.6.6.jar及aspectjrt-1.6.6.jar
2,拼写错误。代码有错误。可以参考我的。
3,如果还未解决。可以留言。
package com.snow.aspect;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
@Component
@Aspect
public class LogAspect {
@Pointcut("execution(public void com.snow.dao.*.add())")
public void logCut4Add() {
}
@Before("logCut4Add()")
public void before() {
System.out.println("before...................");
}
@After("logCut4Add()")
public void after() {
System.out.println("after..................");
}
}
本文介绍了在使用Spring AOP时遇到的一个常见问题——找不到引用的切入点,并提供了三种解决方法,包括检查版本兼容性、代码拼写错误以及提供了一个正确的示例代码。

被折叠的 条评论
为什么被折叠?



