• error at ::0 can't find referenced pointcut pointCutName 错误解决方法


    Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate); nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut pointCutName
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:599)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:92)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
    ... 65 more

    Caused by: java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut pointCutName


    今天在又一次复习Spring AOP的时候。使用aspectJ注解来实现Spring AOP时,用以下这样的方式来获得pointCut时报错了:

    	@Pointcut(value = "execution(* com.westsoft.kft.repairs.service.impl.*.*(..))")
    	public void pointCutName() {
    
    	}
    
    	@Before(value = "pointCutName()")
    	public void before(JoinPoint jp) {
    		System.out.println("before----------" + jp.getSignature().getName());
    	}
    
    	@After(value = "pointCutName()")
    	public void after(JoinPoint jp) {
    		System.out.println("after-----------" + jp.getSignature().getName());
    	}
    }

    上网查了,发现是aspectjweaver-1.5.2.jar这个包版本号太低,于是去官网http://www.eclipse.org/aspectj/downloads.php下载了个最新版的替换

    下载下来的aspectj-1.8.1里有4个jar包:aspectjrt.jar、aspectjtools.jar、aspectjweaver.jar和org.aspectj.matcher.jar

    其余三个我也不知道有什么用,我仅仅替换了当中的aspectjweaver.jar就攻克了我的问题~

  • 相关阅读:
    冒泡排序
    数组去重
    DOM 操作入门(二)
    DOM 操作入门(一)----- 在指定位置动态插入节点
    事件流的捕获和冒泡 ---- 事件对象
    call, apply, bind -----【改变this指向的三大利器】
    闭包和垃圾回收机制
    回调函数 -----【全球化下的产业分工】
    处理Excel表格里面的数据
    Web后台获取服务器相关信息
  • 原文地址:https://www.cnblogs.com/slgkaifa/p/6868862.html
Copyright © 2020-2023  润新知