Spring error at ::0 can't find referenced pointcut myMethod异常

25 篇文章 0 订阅
16 篇文章 0 订阅

Spring error at ::0 can’t find referenced pointcut myMethod等异常的解决

  刚刚在使用声明方式的AOP编程中,遇到以下两个问题,解决方法如下:

  (1)error at ::0 formal unbound in pointcut

  解决方法:去掉函数通知函数中的参数,比如:将

  @Before(“execution(public void com.zjw.dao.impl.UserDAOImpl.*(..))”)

  error at ::0 can’t find referenced pointcut myMethod

  public void beforeMethod(Method method){

  System.out.println(“method before”);

  }

  改为

  @Before(“execution(public void com.zjw.dao.impl.UserDAOImpl.*(..))”)

  public void beforeMethod(){

  System.out.println(“method before”);

  }

  (2)com\zjw\dao\Impl\UserDAOImpl.class]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can’t find referenced pointcut myMethod

  错误原因:如果你用的JDK版本是1.6的话,而引用的aspectjrt.jar是spring-2.0中包含的jar包的情况下就会报这样的错误。
解决方法:就是下载最新的aspectjrt的jar包即可,或者使用spring3.0中的包!在这边我使用的aspectjrt.jar居然是1.1的 所以出错了 改为aspectj最新版aspectj就没问题了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值