Olá
Meu cenário: aplicação JSF/Demoiselle que invoca um método de EJB, ambos hospedados em um servidor JBoss AS 7.1.1. Durante operações de insert e update em uma página CRUD, a aplicação Demoiselle tem que salvar seus dados em seu próprio DataSource e também salvar alguns outros dados em outroa aplicação por meio da chamada de métodos de EJB, que usará outro DataSource. O dois DataSources estão configurados para usar JTA (JTA checkbox marcado na configuração do JBoss).
Apenas em casos de update, a tentativa de savar dados lança uma exceção. As últimas partes do stack de exceção seguem:
Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@14729cfa[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@6a370d1a connection handles=0 lastUse=1467805740289 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@7a5d9cca pool internal context=SemaphoreArrayListManagedConnectionPool@31c571ea[pool=CartaoDS] xaResource=LocalXAResourceImpl@11061a5f[connectionListener=14729cfa connectionManager=4b45c7aa warned=false currentXid=null] txSync=null]
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:147)
at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:281)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297)
... 175 more
Caused by: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@14729cfa[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@6a370d1a connection handles=0 lastUse=1467805740289 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@7a5d9cca pool internal context=SemaphoreArrayListManagedConnectionPool@31c571ea[pool=CartaoDS] xaResource=LocalXAResourceImpl@11061a5f[connectionListener=14729cfa connectionManager=4b45c7aa warned=false currentXid=null] txSync=null]
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:604)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:467)
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:139)
... 178 more
Caused by: javax.resource.ResourceException: IJ000461: Could not enlist in transaction on entering meta-aware object
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:474)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:599)
... 180 more
Caused by: javax.transaction.SystemException: IJ000356: Failed to enlist: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 0:ffff0a0a0546:2fd05d09:577134fa:61c7a status: ActionStatus.ABORT_ONLY >
at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.checkEnlisted(TxConnectionListener.java:552)
at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:282)
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:467)
... 181 more
Quando eu desabilito JTA no DataSource do EJB o problema some.
O que está errado com as minhas configurações?
Desde já agradeço!