SpingAOP 报错ed in file [F:\eclipse-workspace\DynamicAgent\bin\springaop\CalculateImp.class]: Initiali

来源:互联网 发布:淘宝开店教程自学网 编辑:程序博客网 时间:2024/06/06 00:04

在测试spingaop的时候,报了一条错误:

警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'calculateImp' defined in file [F:\eclipse-workspace\DynamicAgent\bin\springaop\CalculateImp.class]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ')' at character position 0execution( public double springaop.CalculateImp.add(double,double)^Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'calculateImp' defined in file [F:\eclipse-workspace\DynamicAgent\bin\springaop\CalculateImp.class]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ')' at character position 0execution( public double springaop.CalculateImp.add(double,double)^

在网上找了找了好多类似错误信息的解决方法,可惜没有一个有用,在崩溃之际,突然看到了在配置切面类的地方有问题:

@Before("execution("double springaop.CalculateImp.add(double, double)")")

上面在execution里面应该没有双引号的!!

@Before("execution(double springaop.CalculateImp.add(double, double))")
阅读全文
0 0
原创粉丝点击