error at ::0 can't find referenced pointcut解决办法(转载)

原文:http://blog.sina.com.cn/s/blog_9ecb0d9d0101fheg.html

Spring中采用annotation的方式实现AOP代理,运行测试代码时抛出以下异常:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException:  Error creating bean with name ‘userManager‘ defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can‘t find referenced pointcut allAddMethod

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

allAddMethod

at org.aspectj.weaver.tools.PointcutParser.parsePointcutexpression_r(PointcutParser.java:315)

at  org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression

(AspectJExpressionPointcut.java:189)

at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch

(AspectJExpressionPointcut.java:176)

at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter

(AspectJExpressionPointcut.java:157)

at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:189)

at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:244)

at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:278)

at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator

.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)

at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator

.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)

at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator

.postProcessAfterInitialization(AbstractAutoProxyCreator.java:296)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:313)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

.initializeBean(AbstractAutowireCapableBeanFactory.java:1181)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

.createBean(AbstractAutowireCapableBeanFactory.java:427)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject

(AbstractBeanFactory.java:249)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton

(DefaultSingletonBeanRegistry.java:155)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean

(AbstractBeanFactory.java:246)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean

(AbstractBeanFactory.java:160)

at org.springframework.beans.factory.support.DefaultListableBeanFactory

.preInstantiateSingletons(DefaultListableBeanFactory.java:291)

at org.springframework.context.support.AbstractApplicationContext.refresh

(AbstractApplicationContext.java:352)

at org.springframework.context.support.ClassPathXmlApplicationContext.                                          (ClassPathXmlApplicationContext.java:122)

at org.springframework.context.support.ClassPathXmlApplicationContext.                                          (ClassPathXmlApplicationContext.java:66)

at com.huang.spring.Client.main(Client.java:10)

本人详细检查过代码和applicationContext.xml配置文件,发现并没有错!而其他Spring项目能运行,因此出错原因可以肯定是aspectj两个jar包的问题。网上很多说法是spring 2.0的版本中的的aspectjrt.jar和jdk不兼容,好吧,本人的JDK是1.7的,于是尝试使用不同版本的aspectjrt.jar文件,发现错误仍然存在!所以不是aspectjrt.jar的问题。

于是本人下载了最新版本的aspectjweaver.jar并替换了原来的版本,error at ::0 can‘t find referenced pointcut allAddMethod成功解决了,程序正常运行。

error at ::0 can't find referenced pointcut解决办法(转载)

时间: 2024-12-03 18:13:36

error at ::0 can't find referenced pointcut解决办法(转载)的相关文章

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.la

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

这个错误是说,找不到这个注释: 解决方案: 1.更改自己本机的jdk版本(我的更改了无效): 在工程选择框内点击右键--->build path----->Library--->add Library 选择JRE System Library ----->next 就可以更改了. 2.更改aspectjweaver.ja的版本,进入官网这一页http://www.eclipse.org/aspectj/downloads.php 选择aspectj-1.8.8.jar进行下载. 完

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 fail

Java入门到精通——调错篇之Spring2.5利用aspect实现AOP时报错: error at ::0 can't find referenced pointcut XXX

一.问题描述及原因. 利用Aspect注解实现AOP的时候出现了error at ::0 can't find referenced pointcut XXX.一看我以为注解写错了,结果通过查询相关资料是因为Spring2.5与中的aspectjweaver.jar 和aspectjrt.jar这两个jar包与JDK1.7不匹配. org.springframework.beans.factory.BeanCreationException: Error creating bean with n

关于“error at ::0 can't find referenced pointcut”错误的处理方式

最近因为公司需求问题,需要将JDK以及Tomcat升级到7.x系列版本,原JDK6.x系列.使用的框架基本类似于三大框架(公司内部框架),在升级过程中遇到:error at ::0 can't find referenced pointcut 这样的错误,导致的原因是由于aspectjrt.jar 和 aspectjweaver.jar版本太低,因此替换为更高的版本,个人建议为:1.66或者以上版本. 下载地址:http://jarfiles.pandaidea.com/search?q=asp

springAOP注解方式定义切入点报错error at ::0 can't find referenced pointcut

[说明] 1.使用spring版本:4.0.4 2.springAOP相关依赖包: 1)aopalliance-1.0.jar 2)aspectjweaver-1.8.9.jar 3)aspectjrt-1.8.9.jar 3.分析: 1)当切面类的方法上通知注解直接输入切入点表达式时,没有报错.切面类代码如下: import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect

error at ::0 can't find referenced pointcut xxx

由于公司使用的框架版本比较久,需要将现有的框架进行升级.项目使用最新版本的struts/spring/hibernate,并使用最新版本的jdk 1.7和最新的tomcat 7. 在项目的classpath中加入spring的最新版本3.2相关的jar包,并且安装好jdk 1.7,配置好相关的环境变量.配置好tomcat 7相关参数(比如tomcat的目录路径,jdk等),发布并运行项目,结果出现了异常,这个异常最后的一句是这样的: error at ::0 can't find referen

【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 fail

AspectJ 出现错误::0 can‘t find referenced pointcut 的解决

使用AspectJ注解开发AOP应用时,会遇到以下问题: ::0 can't find referenced pointcut 这个问题,实际是与你所在的开发环境有关,如下表 jdk version spring version aspectjrt version and aspectjweaver version 1.6 3.0 + aspectjrt-1.6.2  and aspectjweaver-1.6.2 1.7 3.0 + aspectjrt-1.7.3 and aspectjwea