码迷,mamicode.com
首页 > 其他好文 > 详细

aop郁闷错误

时间:2015-04-28 20:56:33      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

很郁闷的错误,终于解决了:

<aop:config>
  <aop:aspect ref="log">
   <aop:pointcut id="aopTest" expression="execution(*com.gc.action.HelloWorldActionDAO.*(..))"/>
   <aop:around method="around" pointcut-ref="aopTest"/>
  </aop:aspect>
 </aop:config>

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘urlMapping‘ defined in ServletContext resource [/WEB-INF/spring-servlet.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 ‘name pattern‘ at character position 47
execution(*com.gc.action.HelloWorldActionDAO.*(..))
                                               ^

修改:

<aop:config>
  <aop:aspect ref="log">
   <aop:pointcut id="aopTest" expression="execution(* com.gc.action.HelloWorldActionDAO.*(..))"/>
   <aop:around method="around" pointcut-ref="aopTest"/>
  </aop:aspect>
</aop:config>

在*后面加一个空格,则解决问题,不错不知道啊,望大家能注意啊。

aop郁闷错误

标签:

原文地址:http://www.cnblogs.com/toSeeMyDream/p/4463884.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!