在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>不知道问题说清楚没有,如果没有说明白,请大家给个提示。
出问题的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>不知道问题说清楚没有,如果没有说明白,请大家给个提示。
解决方案 »
- 会JSP或者JAVA进,急急急,求帮忙
- JSP上如何保存2为FLOAT???
- 在jsp中java的作用??
- 我是一个新手,初写JSP+JAVABEAN的网页,出现了一个很头疼的问题,请高手帮帮忙!
- jsp开发中遇到的几个小问题
- spring-security3 怎么设置 才能使资源库中没有的url就不让访问
- Strust中*.properties的位置
- 在jsp中如何判断结果集为空?重定向用什么语句??在线等!!!!
- 用mm.mysql-2.0.14数据库驱动,中文出现问题怎么办?
- 有关查询分页的问题 !
- The type net.sf.hibernate.LockMode cannot be resolved. It is indirectly 问题 谢谢各位
- 什么是servlet容器,它与selvert的关系是什么?
<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>
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property> 需加上
</bean>