为了账号安全,请及时绑定邮箱和手机立即绑定

异常不能解决 ,求助!!

异常不能解决 ,求助!!

qq_愿有智慧_03738976 2016-09-16 20:48:35
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'moocAspect' defined in class path resource [spring-aop.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ')' at character position 11excution(* com.imooc.my.AspectBiz.*(..))
查看完整描述

5 回答

已采纳
?
星际怪物

TA贡献31条经验 获得超10个赞

这不告诉你了吗,excution(* com.imooc.my.AspectBiz.*(..)) 切入点正则表达式有误

查看完整回答
反对 回复 2016-09-17
?
梵天001

TA贡献23条经验 获得超5个赞

亲,是由于你缺了aspectj.jar包哦。

查看完整回答
2 反对 回复 2017-01-10
?
驮着阳光的希望

TA贡献1条经验 获得超0个赞

因为没有jar包解析execute里面的表达式所以报错误

查看完整回答
反对 回复 2017-06-21
?
qq_愿有智慧_03738976

TA贡献2条经验 获得超0个赞


使用<aop:before method="before" pointcut-ref="moocPointcut" />报错!注释了就不报错

查看完整回答
反对 回复 2016-09-16
?
大咪

TA贡献785条经验 获得超332个赞

<p dir="ltr">.AspectJPointcutAdvisor#0':这个是你自己创建的类吗,代码上来看看</p>
查看完整回答
反对 回复 2016-09-16
  • qq_愿有智慧_03738976
    qq_愿有智慧_03738976
    <p dir="ltr">.AspectJPointcutAdvisor#0'这不是我建的类, 我使用<aop:before method="before" pointcut-ref="moocPointcut" />就报错,注释了就不报错!
  • qq_愿有智慧_03738976
    qq_愿有智慧_03738976
    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd "> <bean id="moocAspect" class="com.imooc.my.MoocAspect"></bean> <bean id="aspectBiz" class="com.mooc.aop.AspectBiz"></bean> <aop:config> <aop:aspect id="moocAspectAop" ref="moocAspect"> <aop:pointcut expression="excution(* com.mooc.aop.AspectBiz.*(..))" id="moocPointcut" /> <aop:before method="before" pointcut-ref="moocPointcut" /> </aop:aspect> </aop:config> </beans> package com.imooc.my; public class MoocAspect { public void before(){ System.out.println("MoocAspect before"); } package com.mooc.aop; public class AspectBiz { public void aopMethod(){ System.out.println("AspectBiz aopMethod"); } } }
  • 5 回答
  • 0 关注
  • 7123 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信