一个关于ejb JTA事务的问题 在线等

问题描述

在网上找了很久还是没解决我的问题!我的开发环境是jboss5myeclipse7数据库oracle11gMsSql2005我要实现的功能是在一个事务里同时对2个数据库进行操作(一个事务里对一个数据库进行操作是可行的)客户端报错Exceptioninthread"main"java.util.NoSuchElementExceptionatjava.util.LinkedList.remove(UnknownSource)atjava.util.LinkedList.removeLast(UnknownSource)atorg.jboss.tm.usertx.client.ClientUserTransaction$ThreadInfo.pop(ClientUserTransaction.java:557)atorg.jboss.tm.usertx.client.ClientUserTransaction.rollback(ClientUserTransaction.java:266)atcom.wuwei.client.Client.test3(Client.java:100)atcom.wuwei.client.Client.main(Client.java:17)服务端报org.hibernate.exception.GenericJDBCException:Cannotopenconnectionatorg.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)atorg.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)atorg.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)atorg.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)atorg.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:116)atorg.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)atorg.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2252)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688)atorg.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)atorg.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)atorg.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)atorg.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)atorg.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)atorg.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)atorg.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)atorg.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)atorg.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)atcom.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101)atcom.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:269)atcom.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:89)atcom.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)atcom.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1423)atcom.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137)atcom.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)atorg.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:171)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:585)atorg.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:123)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:585)atorg.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)atorg.jboss.mx.server.Invocation.dispatch(Invocation.java:96)atorg.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)atorg.jboss.mx.server.Invocation.invoke(Invocation.java:90)atorg.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)atorg.jboss.mx.server.Invocation.invoke(Invocation.java:90)atorg.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)atorg.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)atorg.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:180)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:585)atorg.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)atorg.jboss.mx.server.Invocation.dispatch(Invocation.java:96)atorg.jboss.mx.server.Invocation.invoke(Invocation.java:88)atorg.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)atorg.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)atorg.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)atorg.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)atorg.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)atorg.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)atorg.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)atorg.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)Causedby:org.jboss.util.NestedSQLException:Couldnotenlistintransactiononenteringmeta-awareobject!;-nestedthrowable:(javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:66status:ActionStatus.ABORT_ONLY>);-nestedthrowable:(org.jboss.resource.JBossResourceException:Couldnotenlistintransactiononenteringmeta-awareobject!;-nestedthrowable:(javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:66status:ActionStatus.ABORT_ONLY>))atorg.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)atorg.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:46)atorg.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)...56moreCausedby:org.jboss.resource.JBossResourceException:Couldnotenlistintransactiononenteringmeta-awareobject!;-nestedthrowable:(javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:66status:ActionStatus.ABORT_ONLY>)atorg.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:409)atorg.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)atorg.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:499)atorg.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)atorg.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)...58moreCausedby:javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:66status:ActionStatus.ABORT_ONLY>atorg.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:879)atorg.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:675)atorg.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:403)...62more12:59:26,820WARN[arjLoggerI18N][com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2]TwoPhaseCoordinator.beforeCompletion-failedforcom.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@16364a1javax.persistence.PersistenceException:org.hibernate.exception.GenericJDBCException:Cannotopenconnectionatorg.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)atorg.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513)

解决方案

解决方案二:
atcom.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101)atcom.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:269)atcom.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:89)atcom.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)atcom.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1423)atcom.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137)atcom.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)atorg.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:171)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:585)atorg.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:123)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:585)atorg.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)atorg.jboss.mx.server.Invocation.dispatch(Invocation.java:96)atorg.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)atorg.jboss.mx.server.Invocation.invoke(Invocation.java:90)atorg.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)atorg.jboss.mx.server.Invocation.invoke(Invocation.java:90)atorg.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)atorg.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)atorg.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:180)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:585)atorg.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)atorg.jboss.mx.server.Invocation.dispatch(Invocation.java:96)atorg.jboss.mx.server.Invocation.invoke(Invocation.java:88)atorg.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)atorg.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)atorg.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)atorg.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)atorg.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)atorg.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)atorg.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)atorg.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)Causedby:org.hibernate.exception.GenericJDBCException:Cannotopenconnectionatorg.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)atorg.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)atorg.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)atorg.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)atorg.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:116)atorg.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)atorg.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2252)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688)atorg.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)atorg.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)atorg.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)atorg.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)atorg.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)atorg.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)atorg.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)atorg.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)atorg.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)...41moreCausedby:org.jboss.util.NestedSQLException:Couldnotenlistintransactiononenteringmeta-awareobject!;-nestedthrowable:(javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:66status:ActionStatus.ABORT_ONLY>);-nestedthrowable:(org.jboss.resource.JBossResourceException:Couldnotenlistintransactiononenteringmeta-awareobject!;-nestedthrowable:(javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:66status:ActionStatus.ABORT_ONLY>))atorg.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)atorg.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:46)atorg.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)...56moreCausedby:org.jboss.resource.JBossResourceException:Couldnotenlistintransactiononenteringmeta-awareobject!;-nestedthrowable:(javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:66status:ActionStatus.ABORT_ONLY>)atorg.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:409)atorg.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)atorg.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:499)atorg.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)atorg.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)...58moreCausedby:javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:66status:ActionStatus.ABORT_ONLY>atorg.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:879)atorg.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:675)atorg.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:403)...62more找了些资料要我配xa的那个XML我把数据源配好后把测试表都删了然后发布entity都能映射到数据库说明我的数据源没问题但是拿客户端连接的时候还是报一样的错服务端报
解决方案三:
13:01:15,068ERROR[STDERR]javax.transaction.xa.XAException:java.sql.SQLException:无法创建XA控制连接。错误:找不到存储过程'master..xp_sqljdbc_xa_init'。。13:01:15,069ERROR[STDERR]atcom.microsoft.sqlserver.jdbc.SQLServerXAResource.start(UnknownSource)13:01:15,069ERROR[STDERR]atorg.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:213)13:01:15,069ERROR[STDERR]atcom.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:799)13:01:15,069ERROR[STDERR]atcom.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:510)13:01:15,069ERROR[STDERR]atorg.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:908)13:01:15,069ERROR[STDERR]atorg.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:662)13:01:15,069ERROR[STDERR]atorg.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:403)13:01:15,069ERROR[STDERR]atorg.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)13:01:15,070ERROR[STDERR]atorg.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:499)13:01:15,070ERROR[STDERR]atorg.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)13:01:15,070ERROR[STDERR]atorg.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)13:01:15,070ERROR[STDERR]atorg.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:46)13:01:15,071ERROR[STDERR]atorg.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)13:01:15,071ERROR[STDERR]atorg.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)13:01:15,072ERROR[STDERR]atorg.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:116)13:01:15,072ERROR[STDERR]atorg.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)13:01:15,072ERROR[STDERR]atorg.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)13:01:15,073ERROR[STDERR]atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2252)13:01:15,073ERROR[STDERR]atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688)13:01:15,073ERROR[STDERR]atorg.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)13:01:15,073ERROR[STDERR]atorg.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)13:01:15,073ERROR[STDERR]atorg.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)13:01:15,073ERROR[STDERR]atorg.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)13:01:15,073ERROR[STDERR]atorg.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)13:01:15,073ERROR[STDERR]atorg.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)13:01:15,073ERROR[STDERR]atorg.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)13:01:15,073ERROR[STDERR]atorg.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)13:01:15,073ERROR[STDERR]atorg.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)13:01:15,074ERROR[STDERR]atcom.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101)13:01:15,074ERROR[STDERR]atcom.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:269)13:01:15,074ERROR[STDERR]atcom.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:89)13:01:15,074ERROR[STDERR]atcom.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)13:01:15,074ERROR[STDERR]atcom.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1423)13:01:15,074ERROR[STDERR]atcom.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137)13:01:15,074ERROR[STDERR]atcom.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)13:01:15,074ERROR[STDERR]atorg.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:171)13:01:15,074ERROR[STDERR]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)13:01:15,074ERROR[STDERR]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)13:01:15,076ERROR[STDERR]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)13:01:15,076ERROR[STDERR]atjava.lang.reflect.Method.invoke(Method.java:585)13:01:15,076ERROR[STDERR]atorg.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:123)13:01:15,076ERROR[STDERR]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)13:01:15,076ERROR[STDERR]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)13:01:15,076ERROR[STDERR]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)13:01:15,076ERROR[STDERR]atjava.lang.reflect.Method.invoke(Method.java:585)13:01:15,076ERROR[STDERR]atorg.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)13:01:15,077ERROR[STDERR]atorg.jboss.mx.server.Invocation.dispatch(Invocation.java:96)13:01:15,077ERROR[STDERR]atorg.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)13:01:15,078ERROR[STDERR]atorg.jboss.mx.server.Invocation.invoke(Invocation.java:90)13:01:15,078ERROR[STDERR]atorg.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)13:01:15,078ERROR[STDERR]atorg.jboss.mx.server.Invocation.invoke(Invocation.java:90)13:01:15,078ERROR[STDERR]atorg.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)13:01:15,078ERROR[STDERR]atorg.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)13:01:15,078ERROR[STDERR]atorg.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:180)13:01:15,078ERROR[STDERR]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)13:01:15,078ERROR[STDERR]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)13:01:15,078ERROR[STDERR]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)13:01:15,078ERROR[STDERR]atjava.lang.reflect.Method.invoke(Method.java:585)13:01:15,078ERROR[STDERR]atorg.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)13:01:15,079ERROR[STDERR]atorg.jboss.mx.server.Invocation.dispatch(Invocation.java:96)13:01:15,079ERROR[STDERR]atorg.jboss.mx.server.Invocation.invoke(Invocation.java:88)13:01:15,079ERROR[STDERR]atorg.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)13:01:15,079ERROR[STDERR]atorg.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)13:01:15,079ERROR[STDERR]atorg.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)13:01:15,079ERROR[STDERR]atorg.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)13:01:15,079ERROR[STDERR]atorg.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)13:01:15,079ERROR[STDERR]atorg.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)13:01:15,079ERROR[STDERR]atorg.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)13:01:15,079ERROR[STDERR]atorg.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)13:01:15,080WARN[JDBCExceptionReporter]SQLError:0,SQLState:null13:01:15,080ERROR[JDBCExceptionReporter]Couldnotenlistintransactiononenteringmeta-awareobject!;-nestedthrowable:(javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:74status:ActionStatus.ABORT_ONLY>);-nestedthrowable:(org.jboss.resource.JBossResourceException:Couldnotenlistintransactiononenteringmeta-awareobject!;-nestedthrowable:(javax.transaction.SystemException:java.lang.Throwable:Unabledtoenlistresource,seethepreviouswarnings.tx=TransactionImple<ac,BasicAction:3d968beb:c2e7:4b3213c4:74status:ActionStatus.ABORT_ONLY>))13:01:15,080ERROR[AbstractFlushingEventListener]Couldnotsynchronizedatabasestatewithsessionorg.hibernate.exception.GenericJDBCException:Cannotopenconnection
解决方案四:
太长了,没想看。
解决方案五:
那能不能指导下JTA分布式管理事务数据源是配置xa_ds的XML还是普通的dsxml呢?
解决方案六:
难道问题真的太长没人愿意看吗?
解决方案七:
我也遇到这个问题,没找到解决方法,期待中...
解决方案八:
呵,终于有人走过我的路了
解决方案九:
试试:在/server/default/conf文件夹中jbossjta-properties.xml文件里<propertiesdepends="arjuna"name="jta">下面增加子节点<propertyname="com.arjuna.ats.jta.allowMultipleLastResources"value="true"/>不知道有没有帮助..
解决方案十:
挖沙,这么多!

时间: 2024-09-16 00:49:04

一个关于ejb JTA事务的问题 在线等的相关文章

Spring集成JOTM的JTA事务管理

Spring中集成JOTM 配置JTA事务: 假如业务中要用到多个数据库,我们希望在业务方法中,当对某一个数据库的数据表进行操作的事务失败并回退(rollback),另外某一个数据库的数据表的操作事务也要回退,但应用一般的事务管理达不到这样的事务管理效果,这就需要实现 JTA 事务管理了. 这里我们在SPring中集成 Object web 的一个开源JTA实现JOTM (可以在http://jotm.objectweb.org下载完整版) 来实现JTA事务管理. 1.将必须的类包放入类路径中:

jta-多数据源配置与JTA事务问题

问题描述 多数据源配置与JTA事务问题 项目中使用两个dataSourc,两个sessionFactory.由于业务变化,需要在项目中切换数据源,单独配置多数据源以及单独配置JTA都能成功,将多数据与JTA整合之后,项目启动总是抛出异常. 异常如下: org.springframework.transaction.IllegalTransactionStateException: Pre-bound JDBC Connection found! HibernateTransactionManag

Spring JTA事务配置JOTM

JTA可以在多个数据库上使用一个事务,weblogic等应用服务器提供了jta数据源的支持,可以直接被使用.但是tomcat本身并不支持这种特性.如果想在tomcat上使用jta就必须使用其它的工具.jotm就是一个独立的可以提供JTA功能的组件. <?xml version="1.0" encoding="UTF-8"?>      <beans xmlns="http://www.springframework.org/schema/

jta-为什么在JMS中使用JTA事务控制全局事务失效

问题描述 为什么在JMS中使用JTA事务控制全局事务失效 package cn.producer; import java.util.Properties; import javax.jms.Connection;import javax.jms.ConnectionFactory;import javax.jms.Destination;import javax.jms.ExceptionListener;import javax.jms.JMSException;import javax.j

spring + hibernate +jta 事务不能回滚问题

问题描述 spring 配置文件<bean id="idcJDBC" class="com.atomikos.jdbc.SimpleDataSourceBean"><property name="uniqueResourceName"><value>db_idcbase</value></property><property name="xaDataSourceClass

SSH 中 用了atomikos集成JTA 事务后,hibernate执行任何操作失败后都不抛异常

问题描述 在项目中, 用了atomikos集成JTA 事务后,hibernate执行任何操作失败后都不抛异常比如,我用getHibernateTemplate().load方法加载一个不存在的数据都不抛出异常,或者我删除一个不存在的记录也不抛异常,谁知道这是什么原因啊?????????? 问题补充:lizhi92574 写道 解决方案 load查询返回代理对象,在你使用的时候才会抛出异常

WCF技术剖析之三十二:一步步创建一个完整的分布式事务应用

在完成了对于WCF事务编程(<上篇>.<中篇>.<下篇>)的介绍后,本篇文章将提供一个完整的分布式事务的WCF服务应用,通过本例,读者不仅仅会了解到如何编程实现事务型服务,还会获得其他相关的知识,比如DTC和AS-AT的配置等.本例还是沿用贯通本章的应用场景:银行转帐.我们将会创建一个BankingService服务,并将其中的转帐操作定义成事务型操作.我们先从物理部署的角度来了解一下BankingService服务,以及需要实现怎样的分布式事务. 一.从部署的角度看分

文档-做一个email系统,做个附件在线打开功能

问题描述 做一个email系统,做个附件在线打开功能 做一个email系统,做个附件在线打开功能,怎么实现,求高人解答,可以调用本地机器上的对应软件么?还是用其他的,如果用其他的有没有详细的文档,谢谢大师 解决方案 用客户端上的软件打开本身是浏览器天然支持的.不需要任何代码就能实现.只要你提供下载即可. 在线浏览要看什么文件,图片可以直接显示,word pdf可以用flashpaper

赶紧接着上一节:Silverlight+WCF 新手实例 象棋 主界面-实时聊天区(二十五) 这节我们实现上节没实现的纠结的进出房间的消息提示 我们清楚的知道,我们每个区都是一个用户控件,我们的在线用户进出时,得到聊天区域显示信息,这就涉及到用户控件之间的消息传递了。 在线用户区说:反正我是

赶紧接着上一节:Silverlight+WCF 新手实例 象棋 主界面-实时聊天区(二十五)  这节我们实现上节没实现的纠结的进出房间的消息提示 我们清楚的知道,我们每个区都是一个用户控件,我们的在线用户进出时,得到聊天区域显示信息,这就涉及到用户控件之间的消息传递了. 在线用户区说:反正我是没权直接去实时聊天区写东西,没办法,找中介委托设置一下了. 那谁是中介呢?委托谁呢?当然是衣食父母Index.xaml了,是它撑着整个家庭的. 好了,知道中介了,那我就签个委托书了: 回到OnlineUse