Atomikos实现分布式事务异常小结

阅读更多

 

2015-11-08 02:47:22:WARN main atomikos - ERROR IN RECOVERY
com.atomikos.datasource.ResourceException: Error in recovery
	at com.atomikos.datasource.xa.XATransactionalResource.recover(XATransactionalResource.java:596)
	at com.atomikos.datasource.xa.XATransactionalResource.endRecovery(XATransactionalResource.java:670)
	at com.atomikos.icatch.imp.TransactionServiceImp.recover(TransactionServiceImp.java:635)
	at com.atomikos.icatch.imp.TransactionServiceImp.init(TransactionServiceImp.java:741)
	at com.atomikos.icatch.imp.BaseTransactionManager.init(BaseTransactionManager.java:217)
	at com.atomikos.icatch.standalone.StandAloneTransactionManager.init(StandAloneTransactionManager.java:104)
	at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:307)
	at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:413)
	at com.atomikos.icatch.jta.UserTransactionManager.checkSetup(UserTransactionManager.java:90)
	at com.atomikos.icatch.jta.UserTransactionManager.init(UserTransactionManager.java:140)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod

 

 

 

解决方案:将数据源AtomikosDataSourceBean替换成AtomikosNonXADataSourceBean。

 

如:


		oracle xa datasource
		
			oracle_ds
		
		
			oracle.jdbc.xa.client.OracleXADataSource
		
		
			
				${oracle.connection.username}
				${oracle.connection.password}
				${oracle.connection.url}
			
		
		
		 
	

 

 

替换成:

 

 


		
		
		
		
		
		
	

 

 

 

2015-11-08 10:18:57:WARN main atomikos - Error delegating 'createClob' call
java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.createClob()Ljava/sql/Clob;
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.atomikos.jdbc.nonxa.AtomikosThreadLocalConnection.invoke(AtomikosThreadLocalConnection.java:306)
	at $Proxy30.createClob(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.hibernate.engine.jdbc.JdbcSupportLoader.useContextualLobCreation(JdbcSupportLoader.java:97)
	at org.hibernate.engine.jdbc.JdbcSupportLoader.loadJdbcSupport(JdbcSupportLoader.java:52)
	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:118)
	at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:793)
	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:715)
	at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:189)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
2015-11-08 10:18:57:INFO main org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as createClob() method threw error 

: java.lang.reflect.InvocationTargetException
2015-11-08 10:18:57:INFO main org.hibernate.cfg.SettingsFactory - Database ->
       name : Oracle

 

 解决方案:

 在SessionFacory配置中,加入

false

 

 

 

 

 

你可能感兴趣的:(Atomikos,异常,ERROR,IN,RECOVERY,Error,delegating,'createClob',call)