error at ::0 formal unbound in pointcut

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

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

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

@Before("execution(public void com.bjsxt.dao.impl.UserDAOImpl.*(..))")

public void beforeMethod(Method method){

System.out.println("method before");

}

改为

@Before("execution(public void com.bjsxt.dao.impl.UserDAOImpl.*(..))")

public void beforeMethod(){

System.out.println("method before");

}

这个办法能解决问题,但是一直不明白,希望有人能帮忙解决一下

(2)error at ::0 can‘t find referenced pointcut myMethod

错误原因如果你用的JDK版本是1.6的话,而引用的aspectjrt.jar是spring-2.0中包含的jar包的情况下就会报这样的错误。 
解决方法就是下载最新的aspectjrt的jar包即可aspectj-1.6.6.jar ,或者使用spring3.0中的包!

时间: 2024-08-09 10:36:28

error at ::0 formal unbound in pointcut的相关文章

引入AOP 报错 error at ::0 formal unbound in pointcut

使用了AOP 后启动报错 九月 27, 2016 2:29:46 下午 org.springframework.context.support.AbstractApplicationContext refresh 警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException:

spring异常-aoperror at :0 formal unbound in pointcut

练习spring的后置增强时遇到了如下问题: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemAction2' defined in class path resource [applicationContext.xml]: BeanPostProcessor before instantiation of bean failed; nested excepti

Spring: aop自动标注时出现 “0 formal unbound in pointcut"

异常代码信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in class path resource [cn/czk/test06/bean.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentExceptio

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

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 clas

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