1.使用Spring2.0配置事件管理,启动Tomcat报以下错误:
严重: 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 'dataSource' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 32
execution(*com.shopping.dao.*.*(..))
^
Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 32
execution(*com.shopping.dao.*.*(..))
解决办法如下:
<aop:config>
<aop:pointcut id="allManagerMethod" expression="execution(* com.mta.car.service.impl.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod" />
</aop:config>
注意(* com....星号后面是有空格,如果没有空格,启动Tomcat时,就报上述错误!)