【Spring实战】—— 12 AspectJ报错:error at ::0 can't find referenced pointcut XXX

今天在使用AspectJ进行注解切面时,遇到了一个错误。

切点表达式就是无法识别——详细报错信息如下:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xingoo' defined in class path resource [bean.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut performance
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.spring.test.chap44.test.main(test.java:8)
Caused by: java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut performance
    at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:315)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:195)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:181)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:162)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:200)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:254)
    at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:286)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    ... 11 more

  上网搜了一下,发现是JDK不匹配。

  我原来用的JDK1.7匹配的是aspectjrt.1.6和aspectjweaver.1.6,因此会报错。

  如果要使用AspectJ完成注解切面需要注意下面的JDK与AspectJ的匹配:

  JDK1.6 —— aspectJ1.6

  JDK1.7 —— aspectJ1.7.3+

  我这里搜到了一个1.7.4的版本,亲测可用。

  下面提供下载地址:

  csdn下载地址

  百度云盘下载地址:AspectJrt-1.7.4.jar AspectJweaver-1.7.4.jar

 

本文转自博客园xingoo的博客,原文链接:【Spring实战】—— 12 AspectJ报错:error at ::0 can't find referenced pointcut XXX,如需转载请自行联系原博主。

时间: 2024-10-24 17:39:58

【Spring实战】—— 12 AspectJ报错:error at ::0 can't find referenced pointcut XXX的相关文章

spring分布式事物-atomikos mssql报错Error in recovery以及找不到存储过程

问题描述 atomikos mssql报错Error in recovery以及找不到存储过程 如题,我使用atomikos做spring分布式事物,同时支持Oracle.MySQL和MSSQL三种数据源.目前Oracle和MySQL都能调通,在测试MSSQL的过程中,一直报错. 错误如下: 2015-06-03 14:08:45,911 WARN com.atomikos.datasource.xa.XATransactionalResource.logWarning:24 - Error i

java+Spring+mybatis 查询sql报错:无效的序列号!

问题描述 java+Spring+mybatis 查询sql报错:无效的序列号! java+Spring+mybatis+lucens+达梦数据库.应该能判断和数据库和lucen没关系.,着急在线等!mybatis: SELECT COUNT(*) FROM ""user_task"" title"" like '%""#{title}""%' And ""status"&qu

linux使用wkhtmltopdf报错error while loading shared libraries:

官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在linux上执行 ./wkhtmltopdf –page-size A4 www.baidu.com pdf.pdf 报错   error while loading shared libraries: libXrender.so.1 root@mag-sit:/home/mag-sit/wkhtmlt

mybatis-我在原有的项目当中按照官方的例子集成了spring websocket,没有报错,但是项目无法启动

问题描述 我在原有的项目当中按照官方的例子集成了spring websocket,没有报错,但是项目无法启动 我的项目是sring+springMVC+Mybatis,JDK为1.7,tomcat 7 按照官方的例子spring web socket demo搞了好几天了,一直是这样,有木有大神帮我看看是怎么回事 主要的代码在这里 @Configuration @EnableWebSocketMessageBroker public class WebSocketConfig extends A

spring+jpa+axis2+memcached 报错!com.google.code.ssm.Settings

问题描述 spring+jpa+axis2+memcached 报错!com.google.code.ssm.Settings org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.google.code.ssm.Settings] is defined: expected single bean but found 0: at org.springframewor

TDDL与Spring Boot集成Version报错——跟踪与解决

先说背景:公司采用diamond+tddl,这套技术来做web管理.本人处于好奇率先体验了下spring-boot,于是就有了spring-boot+tddl的组合.但是jar包上线后,屡屡发现一条error日志不痛不痒的出现在日志文件中,处于程序员的本能,怎么能允许error日志出现在我的系统中呢! 于是,展开了一段tddl与spring-boot的爱恨之旅... 挣扎期 首先看错误提示: 2017-09-27 11:15:58,428 [main] ERROR com.taobao.tddl

lnk1120-vs2010运行程序报错:error LNK2019: 无法解析的外部符号

问题描述 vs2010运行程序报错:error LNK2019: 无法解析的外部符号 如题,我在vs2010环境下做C++练习题时出现该错误.程序代码如下: //array.h#ifndef ARRAY_H#define ARRAY_Htemplate<typename T>class Array{public: Array(int n);//数组首地址不用指定,待会分配 Array(Array &a); ~Array(); T getAt(int i);//返回第i个数组元素 voi

php图片上传报错error=3

问题描述 php图片上传报错error=3 upload: <?php/** Created by PhpStorm. User: rosen Date: 15-11-5 Time: 下午8:43*/print_r($_FILES['file']); ?> 为什么程序运行结果报错Array ( [name] => 2015-10-19 18:47:42屏幕截图.png [type] => [tmp_name] => [error] => 3 [size] => 0

spring aop 配置文件提示报错,但程序能正常运行

问题描述 spring aop 配置文件提示报错,但程序能正常运行 spring aop 配置的时候报错导入的jar包如下: 程序运行没有问题,但是这个报错总是存在,找了很多资料,始终没有解决,求大神赐教! 解决方案 未导入spring对应的DTD标签库