Spring的配置事务,请大家帮忙!!!

dream79 2008-10-07 08:24:57
在Spring的配置事务的过程中,出现如下错误,

Configuration problem: Cannot locate BeanDefinitionDecorator for element [advice]

请大家给帮帮忙,自己不知道是为什么?
出问题的Spring配置文件如下: 
<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"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd" >


<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml </value>
</property>
</bean>


<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>


<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="modify*" propagation="REQUIRED"/>

<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>


<aop:config>
<aop:pointcut id="allManagerMethod" expression="execution(* edu.ysu.usermgr.manager.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod"/>
</aop:config>

</bean>
</beans>

不知道问题说清楚没有,如果没有说明白,请大家给个提示。
...全文
208 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
sjqzone 2009-03-07
  • 打赏
  • 举报
回复
就是就是
anhy 2008-10-07
  • 打赏
  • 举报
回复
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>

需加上
</bean>
yougucao379548695 2008-10-07
  • 打赏
  • 举报
回复
<!-- 配置哪些类的方法需要进行事务管理 -->
<aop:config>
<aop:advisor pointcut="execution(* *..CcamsService.*(..))" advice-ref="txAdvice"/>
</aop:config>
<!-- 配置事务特性 -->
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="insert*"/>
<tx:method name="update*"/>
<tx:method name="del*"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
gonxi 2008-10-07
  • 打赏
  • 举报
回复
低级错误,检查下第二个bean的设置,
anhy 2008-10-07
  • 打赏
  • 举报
回复
提示好像是“不能定位advice配置的封装”

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧