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,拼写错误。代码有错误。可以参考我的。
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..................");
}
}
转自:http://blog.csdn.net/snowjlz/article/details/8167215