druid分布式事务的配置后应用启动不了

zdp2014 发布于 2015/01/06 12:52
阅读 2K+
收藏 1

@wenshao 你好,想跟你请教个问题:druid做分布式时配置数据源,如下配置,导致应用起不来,一直在启动中


<bean id="mysqlDataSource_1" class="com.alibaba.druid.pool.xa.DruidXADataSource" init-method="init" destroy-method="close">
<!-- 基本属性 url、user、password -->
<property name="url" value="${url}" />
<property name="username" value="${username}" />
<property name="password" value="${password}" />
<!-- 配置监控统计拦截的filters -->
<property name="filters" value="stat" />
</bean>


<bean id="mysqlDataSource1" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close">
<property name="uniqueResourceName" value="MYSQL_1" />
<property name="xaDataSource" ref="mysqlDataSource_1" />
<property name="poolSize" value="10" />
<property name="minPoolSize" value="10" />
<property name="maxPoolSize" value="30" />
</bean>


<!-- atomikos分布式事物 -->
<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close">
<property name="forceShutdown" value="true" />
</bean>
<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
<property name="transactionTimeout" value="300" />
</bean>
<bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="atomikosTransactionManager" />
<property name="userTransaction" ref="atomikosUserTransaction" />
<property name="allowCustomIsolationLevels" value="true" />
<property name="globalRollbackOnParticipationFailure" value="true" />
</bean>


<tx:annotation-driven transaction-manager="jtaTransactionManager" proxy-target-class="true" />

以下是启动日志

****  INFO - 2015-01-06 11:43:30,249 - AtomikosDataSoureBean 'MYSQL_1': init... - com.atomikos.logging.Slf4jLogger.logInfo(Slf4jLogger.java:16) main 4472 
****  INFO - 2015-01-06 11:43:30,260 - AtomikosDataSoureBean 'MYSQL_1': initializing with [ xaDataSourceClassName=null, uniqueResourceName=MYSQL_1, maxPoolSize=30, minPoolSize=10, borrowConnectionTimeout=30, maxIdleTime=60, reapTimeout=0, maintenanceInterval=60, testQuery=null, xaProperties=[], loginTimeout=0, maxLifetime=0] - com.atomikos.logging.Slf4jLogger.logInfo(Slf4jLogger.java:16) main 4483 
**** DEBUG - 2015-01-06 11:43:30,273 - Configuration: adding resource MYSQL_1 - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4496 
**** DEBUG - 2015-01-06 11:43:30,273 - Installing recovery service on resource MYSQL_1 - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4496 
**** DEBUG - 2015-01-06 11:43:30,274 - MYSQL_1: refreshing XAResource... - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4497 
****  INFO - 2015-01-06 11:43:30,276 - New update(s) found: 2.4.7 [http://www.terracotta.org/confluence/display/release/Release+Notes+Ehcache+Core+2.4]. Please check http://ehcache.org for the latest version. - net.sf.ehcache.util.UpdateChecker.doCheck(UpdateChecker.java:98) net.sf.ehcache.CacheManager@4e44ac6a 4499 
****  INFO - 2015-01-06 11:43:30,547 - MYSQL_1: refreshed XAResource - com.atomikos.logging.Slf4jLogger.logInfo(Slf4jLogger.java:16) main 4770 
**** DEBUG - 2015-01-06 11:43:30,547 - recovery initiated for resource MYSQL_1 with branchIdentifier 10.144.32.149.tm - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4770 
**** DEBUG - 2015-01-06 11:43:30,550 - endRecovery() done for resource MYSQL_1 - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4773 
**** DEBUG - 2015-01-06 11:43:30,550 - Configuration: added resource MYSQL_1 - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4773 
**** DEBUG - 2015-01-06 11:43:30,559 - atomikos connection pool 'MYSQL_1': initializing... - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4782 
**** DEBUG - 2015-01-06 11:43:30,588 - an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s): registering listener atomikos connection pool 'MYSQL_1' - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4811 
**** DEBUG - 2015-01-06 11:43:30,605 - an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s): registering listener atomikos connection pool 'MYSQL_1' - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4828 
**** DEBUG - 2015-01-06 11:43:30,624 - an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s): registering listener atomikos connection pool 'MYSQL_1' - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4847 
**** DEBUG - 2015-01-06 11:43:30,638 - an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s): registering listener atomikos connection pool 'MYSQL_1' - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4861 
**** DEBUG - 2015-01-06 11:43:30,657 - an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s): registering listener atomikos connection pool 'MYSQL_1' - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4880 
**** DEBUG - 2015-01-06 11:43:30,677 - an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s): registering listener atomikos connection pool 'MYSQL_1' - com.atomikos.logging.Slf4jLogger.logDebug(Slf4jLogger.java:20) main 4900 
**** DEBUG - 2015-01-06 11:43:30,696 - an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s): registering listener atomikos connection pool 'MYSQL_1'

加载中
0
zdp2014
zdp2014
初步怀疑是<property name="filters" value="stat" />配多了的原因,因有2个数据源
zdp2014
zdp2014
参数配置问题,去掉下面配置就可以了.但spring的监控没有数据.其他监控正常 <property name="poolSize" value="10" /> <property name="minPoolSize" value="10" />
返回顶部
顶部