最近项目在WAS环境下部署测试中,发现一个怪异的问题,在Tomcat下面跑的好好的系统,换到WAS环境,竟然在系统登录时抛了个 proxy handle is no longer valid的错误:
?
nested exception is org.hibernate.HibernateException: proxy handle is no longer valid at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:206) at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:606) at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:488) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
?开始以为是自己的事务配置有问题导致的,于是关闭掉了事务声明的地方,结果出乎意料,竟然正常了,不过系统不能不要事务处理啊
?
我系统配置是Spring3.1+hibernate4.1.2,was版本是7.0.0.23
spring.xml配置如下:
?
<?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 4 xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee" 5 xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa" 6 xsi:schemaLocation=" 7 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 8 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd 9 http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd 10 http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd 11 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd 12 http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd" 13 default-autowire="byName" default-lazy-init="true"> 14 15 <!-- 数据源配置, 使用proxool数据库连接池 --> 16 <bean id="dataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource"> 17 <property name="driver" value="${jdbc.driverClassName}" /> 18 <property name="driverUrl" value="${jdbc.url}" /> 19 <property name="user" value="${jdbc.username}" /> 20 <property name="password" value="${jdbc.password}" /> 21 <property name="alias" value="${jdbc.alias}" /> 22 <property name="maximumActiveTime" value="1800000" /> 23 <property name="prototypeCount" value="1" /> 24 <property name="maximumConnectionCount" value="200" /> 25 <property name="minimumConnectionCount" value="1" /> 26 <property name="houseKeepingTestSql" value="${dataSource.houseKeepingTestSql}"/> 27 <property name="trace" value="false" /> 28 </bean> 29 30 32 <!-- Hibernate SessionFactory --> 33 <bean id="sessionFactory" 34 class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> 35 <property name="dataSource" ref="dataSource" /> 36 <property name="hibernateProperties"> 37 <props> 38 <prop key="hibernate.dialect">${hibernate.dialect}</prop> 39 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> 40 <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> 41 <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop> 42 <prop key="hibernate.jdbc.fetch_size">${hibernate.jdbc.fetch_size}</prop> 43 <prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop> 44 <prop key="hibernate.query.factory_class">${hibernate.query.factory_class}</prop> 45 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> 46 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> 47 <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop> 48 <!--<prop key="hibernate.cache.provider_configuration_file_resource_path">/cache/ehcache-hibernate-local.xml</prop> 49 c3p0 connection pool config <prop key="hibernate.connection.provider_class">${hibernate.connection.provider_class}</prop> --> 50 <!-- unit test open it <prop key="hibernate.hbm2ddl.auto"> ${hibernate.hbm2ddl.auto}</prop> --> 51 </props> 52 </property> 53 <property name="mappingDirectoryLocations"> 54 <list> 55 <value>classpath*:com/entity</value> 56 </list> 57 </property> 58 </bean> 59 60 61 <!-- Transaction manager for a single Hibernate SessionFactory (alternative 62 to JTA) --> 63 <bean id="transactionManager" 64 class="org.springframework.orm.hibernate4.HibernateTransactionManager"> 65 <property name="sessionFactory" ref="sessionFactory" /> 66 </bean> 67 68 <!-- 定义事务管理器(声明式的事务) --> 69 <bean id="transactionInterceptor" 70 class="org.springframework.transaction.interceptor.TransactionInterceptor"> 71 <property name="transactionManager" ref="transactionManager" /> 72 <!-- 配置事务属性 --> 73 <property name="transactionAttributes"> 74 <props> 75 <prop key="add*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 76 </prop> 77 <prop key="recovery*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 78 </prop> 79 <prop key="alter*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 80 </prop> 81 <prop key="edit*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 82 </prop> 83 <prop key="batch*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 84 </prop> 85 <prop key="change*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 86 </prop> 87 <prop key="compare*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 88 </prop> 89 <prop key="create*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 90 </prop> 91 <prop key="delete*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 92 </prop> 93 <prop key="del*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 94 </prop> 95 <prop key="execute*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 96 </prop> 97 <prop key="export*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 98 </prop> 99 <prop key="gen*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 100 </prop> 101 <prop key="import*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 102 </prop> 103 <prop key="insert*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 104 </prop> 105 <prop key="promulgate*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 106 </prop> 107 <prop key="publish*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 108 </prop> 109 <prop key="release*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 110 </prop> 111 <prop key="reset*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 112 </prop> 113 <prop key="save*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 114 </prop> 115 <prop key="execute*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 116 </prop> 117 <prop key="modify*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 118 </prop> 119 <prop key="activate*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 120 </prop> 121 <prop key="grant*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 122 </prop> 123 <prop key="ungrant*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 124 </prop> 125 <prop key="syn*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 126 </prop> 127 <prop key="update*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 128 </prop> 129 <prop key="version*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 130 </prop> 131 <prop key="disEnable*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 132 </prop> 133 <prop key="enable*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 134 </prop> 135 <prop key="write*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 136 </prop> 137 <prop key="check*">PROPAGATION_REQUIRED,readOnly</prop> 138 <prop key="count*">PROPAGATION_REQUIRED,readOnly</prop> 139 <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> 140 <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> 141 <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop> 142 <prop key="output*">PROPAGATION_REQUIRED,readOnly</prop> 143 <prop key="parse*">PROPAGATION_REQUIRED,readOnly</prop> 144 <prop key="query*">PROPAGATION_REQUIRED,readOnly</prop> 145 <prop key="show*">PROPAGATION_REQUIRED,readOnly</prop> 146 </props> 147 </property> 148 </bean> 149 150 <!-- 注册自动代理创建,为业务Bean添加事务拦截器 --> 151 <bean 152 class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> 153 <property name="beanNames"> 154 <list> 155 <value>*Service</value> 156 </list> 157 </property> 158 <property name="interceptorNames"> 159 <list> 160 <!-- 事务控制 --> 161 <value>transactionInterceptor</value> 162 </list> 163 </property> 164 </bean> 165 166 </beans>
?检查了一下,没有问题。。。怎么办?
?
?
- 思路1:修改事务配置
谷歌一下,有很多人说是WAS自己接管事务的问题,可以参考帖子:
http://www.ibm.com/developerworks/cn/websphere/techjournal/0609_alcott/0609_alcott.html
摘要如下:
?
使用 Spring 处理事务 WebSphere Application Server 为事务处理和管理与资源提供者的连接提供了一个稳健和可伸缩的环境。无论是否在使用全局事务,与 JDBC、JMS 和 Java Connector 资源适配器的连接均由 WebSphere Application Server 管理;甚至在缺少全局事务时,始终存在一个运行时上下文,在该上下文中可以访问所有资源提供者连接。WebSphere Application Server 将此运行时上下文称为本地事务容器 (LTC) 作用域;在缺少全局事务时始终存在一个 LTC,并且无论是存在全局事务还是 LTC,资源访问始终由运行时管理。为确保事务上下文管理的完整性,以便可以正确管理事务资源,WebSphere Application Server 不向 WebSphere Application Server 中部署的应用程序或应用程序框架公开 javax.transaction.TransactionManager 接口。 在 Spring 中,有许多方法可以驱动事务控制下的资源更新,这包括编程形式和声明形式。声明形式包括 Java Annotation 和 XML 描述符形式。如果将 Spring 2.5 与 WebSphere Application Server V6.0.2.19 或 V6.1.0.9 或者更高版本一起使用,则可以利用对 Spring 的声明式事务模型的完全支持。Spring 2.5 有一个新的用于 WebSphere Application Server 的 PlatformTransactionManager 类,名为 WebSphereUowTransactionManager。该类利用 WebSphere Application Server 的受支持 UOWManager 接口进行事务上下文管理。通过 WebSphere Application Server 的 UOWManager 类管理事务划分可以确保在访问资源提供者时始终可以使用适当的全局事务或 LTC 上下文。不过,早期版本的 Spring 使用了内部 WebSphere 接口,以牺牲 Web 和 EJB 容器功能为代价来管理资源,并且不支持由应用程序使用。这会使容器处于未知状态,从而有可能导致数据损坏。 Spring 2.5 或更高版本中的声明式事务划分在 WebSphere Application Server 中受支持,它使用下面的声明提供对 WebSphere 事务的支持: <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager"/> 引用此声明的 Spring Bean 然后将使用标准 Spring 依赖项注入来使用事务支持,例如: <bean id="someBean" class="some.class"> <property name="transactionManager" > <ref bean="transactionManager"/> </property> </bean> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> 或者,在 Spring 2.5 以后的版本中,可以利用 Spring 的 AspectJ 支持。在下面的示例中,可以将 <tx:advice/> 应用于应用程序的各个部分。这指示所有以“get”开头的方法都是 PROPAGATION_REQUIRED,并且所有以“set”开头的方法都是 PROPAGATION_REQUIRES_NEW。所有其他方法使用缺省事务设置。 <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="set*" propagation="REQUIRES_NEW" /> <tx:method name="*" /> </tx:attributes> </tx:advice> <aop:config/> 标记将那些设置应用于类 MyService 中定义的任何已执行操作。 <aop:config> <aop:pointcut id="myServiceOperation" expression="execution(* sample.service.MyService.*(..))"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="myServiceOperation"/> </aop:config>
?好了,按照以上的说明,修改transactionManager配置,改为
?
?
<bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager"/>
?重新部署,启动就报错了
?
?
Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.springframework.transaction.jta.WebSphereUowTransactionManager] to required type [javax.transaction.TransactionManager] for property 'transactionManager': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
?查询WebSphereUowTransactionManager的API,发现人家根本不是来自于javax.transaction.TransactionManager
?
好了,这条路看来不通,继续谷歌。。。。
- 思路2:验证was版本,换版本试试
? ? ? ? ? ?was版本换到7.0.0.11,测试,竟然成功了!!!
? ?????????这让情何以堪啊,难道让客户去换was?唉。。。
- 思路3:降低Hibernate版本
- 在国外网站上发现了这个帖子
? http://forum.spring.io/forum/spring-projects/data/115503-websphere-7-spring-3-1-hibernate-4
多么相似的问题,马上看解决办法The?'only'?resolution?was?to?downgrade?the?Hibernate?to?version?3.?It?more?or?less?worked?straight?away?then.好吧,没办法了,把hibernate4.1.2降低到hibernate3.2,测试。。。结果依旧,这下有点郁闷到了。
不甘心啊,这个太折腾人了,不出个结果怎么行呢,于是继续换版本,把hibernate换到 3.6版本。测试之。。。终于,ok了。
hibernate3.6下spring配置贴出来: -
1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 4 xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee" 5 xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa" 6 xsi:schemaLocation=" 7 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 8 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd 9 http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd 10 http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd 11 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd 12 http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd" 13 default-autowire="byName" default-lazy-init="true"> 14 15 <!-- 数据源配置, 使用proxool数据库连接池 --> 16 <bean id="dataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource"> 17 <property name="driver" value="${jdbc.driverClassName}" /> 18 <property name="driverUrl" value="${jdbc.url}" /> 19 <property name="user" value="${jdbc.username}" /> 20 <property name="password" value="${jdbc.password}" /> 21 <property name="alias" value="${jdbc.alias}" /> 22 <property name="maximumActiveTime" value="1800000" /> 23 <property name="prototypeCount" value="1" /> 24 <property name="maximumConnectionCount" value="200" /> 25 <property name="minimumConnectionCount" value="1" /> 26 <property name="houseKeepingTestSql" value="${dataSource.houseKeepingTestSql}"/> 27 <property name="trace" value="false" /> 28 </bean> 29 30 <!-- Hibernate SessionFactory --> 31 <bean id="sessionFactory" 32 class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> 33 <property name="dataSource" ref="dataSource" /> 34 <property name="hibernateProperties"> 35 <props> 36 <prop key="hibernate.dialect">${hibernate.dialect}</prop> 37 <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> 38 <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> 39 <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop> 40 <prop key="hibernate.jdbc.fetch_size">${hibernate.jdbc.fetch_size}</prop> 41 <prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop> 42 <prop key="hibernate.query.factory_class">${hibernate.query.factory_class}</prop> 43 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> 44 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> 45 <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop> 46 </props> 47 </property> 48 <property name="mappingDirectoryLocations"> 49 <list> 50 <value>classpath*:com/entity</value> 51 </list> 52 </property> 53 </bean> 54 55 56 <!-- Transaction manager for a single Hibernate SessionFactory (alternative 57 to JTA) --> 58 <bean id="transactionManager" 59 class="org.springframework.orm.hibernate3.HibernateTransactionManager"> 60 <property name="sessionFactory" ref="sessionFactory" /> 61 </bean> 62 63 <!-- 定义事务管理器(声明式的事务) --> 64 <bean id="transactionInterceptor" 65 class="org.springframework.transaction.interceptor.TransactionInterceptor"> 66 <property name="transactionManager" ref="transactionManager" /> 67 <!-- 配置事务属性 --> 68 <property name="transactionAttributes"> 69 <props> 70 <prop key="add*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 71 </prop> 72 <prop key="recovery*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 73 </prop> 74 <prop key="alter*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 75 </prop> 76 <prop key="edit*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 77 </prop> 78 <prop key="batch*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 79 </prop> 80 <prop key="change*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 81 </prop> 82 <prop key="compare*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 83 </prop> 84 <prop key="create*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 85 </prop> 86 <prop key="delete*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 87 </prop> 88 <prop key="del*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 89 </prop> 90 <prop key="execute*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 91 </prop> 92 <prop key="export*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 93 </prop> 94 <prop key="gen*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 95 </prop> 96 <prop key="import*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 97 </prop> 98 <prop key="insert*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 99 </prop> 100 <prop key="promulgate*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 101 </prop> 102 <prop key="publish*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 103 </prop> 104 <prop key="release*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 105 </prop> 106 <prop key="reset*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 107 </prop> 108 <prop key="save*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 109 </prop> 110 <prop key="execute*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 111 </prop> 112 <prop key="modify*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 113 </prop> 114 <prop key="activate*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 115 </prop> 116 <prop key="grant*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 117 </prop> 118 <prop key="ungrant*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 119 </prop> 120 <prop key="syn*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 121 </prop> 122 <prop key="update*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 123 </prop> 124 <prop key="version*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 125 </prop> 126 <prop key="disEnable*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 127 </prop> 128 <prop key="enable*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 129 </prop> 130 <prop key="write*">PROPAGATION_REQUIRED,-RollbackableBizException,-BizException 131 </prop> 132 <prop key="check*">PROPAGATION_REQUIRED,readOnly</prop> 133 <prop key="count*">PROPAGATION_REQUIRED,readOnly</prop> 134 <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> 135 <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> 136 <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop> 137 <prop key="output*">PROPAGATION_REQUIRED,readOnly</prop> 138 <prop key="parse*">PROPAGATION_REQUIRED,readOnly</prop> 139 <prop key="query*">PROPAGATION_REQUIRED,readOnly</prop> 140 <prop key="show*">PROPAGATION_REQUIRED,readOnly</prop> 141 </props> 142 </property> 143 </bean> 144 145 <!-- 注册自动代理创建,为业务Bean添加事务拦截器 --> 146 <bean 147 class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> 148 <property name="beanNames"> 149 <list> 150 <value>*Service</value> 151 </list> 152 </property> 153 <property name="interceptorNames"> 154 <list> 155 <!-- 事务控制 --> 156 <value>transactionInterceptor</value> 157 </list> 158 </property> 159 </bean> 160 161 </beans>
?呵呵,其实也没有改什么内容,注意一下jar包就可以了
至此,问题总算是有了个解决,至于原因,后面有时间再研究了。。。