zoukankan      html  css  js  c++  java
  • Spring error at ::0 can't find referenced pointcut myMethod异常

    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)comzjwdaoImplUserDAOImpl.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就没问题了

  • 相关阅读:
    关于PCA主成分分析的一点理解
    python前言
    python
    unitest单元测试TestCase 执行测试用例(二) 断言
    python基础
    python-requests中get请求接口测试
    python数据类型字典和集合
    python数据类型 列表+元组
    函数是什么?函数式编程
    sql常用
  • 原文地址:https://www.cnblogs.com/lllini/p/11955359.html
Copyright © 2011-2022 走看看