spring中配置事务管理的问题

我的Spring配置文件中加上下面的配置,程序启动就报404,是为什么?

<tx:advice id="txAdvice" transaction-manager="transactionManager">
  <tx:attributes>
   <tx:method name="get*" propagation="REQUIRED" read-only="true" />
   <tx:method name="del*" propagation="REQUIRED" />
   <tx:method name="save*" propagation="REQUIRED" />
   <tx:method name="update*" propagation="REQUIRED" />
  </tx:attributes>
</tx:advice>    

<aop:config>
    <aop:pointcut id="servicesMethod" expression="execution(* com.yklis.service.*.*(..))" />
    <aop:advisor advice-ref="txAdvice" pointcut-ref="servicesMethod" />
</aop:config>

去掉这个配置就正常

先来看看这个spring的配置文件的配置:

 

  <!-- 事务管理器 -->
 <bean id="transactionManager"
  class="org.springframework.orm.hibernate3.HibernateTrans......
答案就在这里:Spring事务管理配置
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

我的配置

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource_master" />            
</bean>

这一段保留,程序都不会报错的!

看看你的切入点,拦截器是不是做了什么别的操作,光看这个看不出来,要不你就从新配置一边试试

看哪里的切入点,哪里的拦截器?

<!-- 使用XML来使用事务管理-->

aop:config

<!-- 配置一个切面,和需要拦截的类和方法 -->





/aop:config



tx:attributes
<!-- 方法以get开头的,不使用事务 -->

<!-- 其他方法以默认事务进行 -->


/tx:attributes

/tx:advice

404是客户端访问为找的资源,说明web没有正常启动。先看看是否少jar导致服务启动异常