Bug 794142 (JBEPP-1208)

Summary: local-tx-datasource prevents Seam Booking Portlet from establishing DB connection
Product: [JBoss] JBoss Enterprise Portal Platform 5 Reporter: Miroslav Cupák <mcupak>
Component: PortalAssignee: Marko Strukelj <mstrukel>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.2.0.ER01CC: epp-bugs, mstrukel, mweiler, mwringe, theute, tkyjovsk
Target Milestone: ---   
Target Release: 5.2.0.ER05   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBEPP-1208
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
EPP 5.2.0.ER01, HSQLDB 2.0.0
Last Closed: 2011-10-19 11:15:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
datasource.log none

Description Miroslav Cupák 2011-09-23 20:32:02 UTC
Workaround: Workaround Exists
Workaround Description: Changing the datasource type in gatein-ds.xml back to no-tx-datasource works for the purpose of Portal Booking Demo.
project_key: JBEPP

Portal Booking Demo is not usable with EPP in default configuration as it can't establish connection to the database. When you type a query in the demo, you get the following error (shortened):

{code}
18:36:44,549 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@31fd8a
18:36:44,575 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
18:36:44,575 ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >))
18:36:44,748 ERROR [TxPolicy] javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
18:36:44,765 SEVERE [event] Received 'javax.ejb.EJBTransactionRolledbackException' when invoking action listener '#{hotelSearch.find}' for component 'j_id16'
18:36:44,806 SEVERE [event] javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:115)
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
        ...
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:103)
        at org.jboss.seam.example.booking.HotelSearchingAction.queryHotels(HotelSearchingAction.java:69)
        ...
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        ...
Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >))
        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
        at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
        ...
Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >)
        at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:475)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)
        ...
Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >
        at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:956)
        at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:752)
        ...

18:36:44,859 ERROR [AjaxViewRoot] Error processing faces event for the component pbG2d9d0ac9_2ded1c_2d4e24_2d80b4_2d0ecfbfd313e9:_viewRoot:searchCriteria:j_id16
javax.faces.event.AbortProcessingException: /main.xhtml @28,101 actionListener="#{hotelSearch.find}": javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:118)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
        ...
Caused by: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:115)
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
        ...
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:103)
        at org.jboss.seam.example.booking.HotelSearchingAction.queryHotels(HotelSearchingAction.java:69)
        ...
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
        ...
Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >))
        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
        at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
        ...
Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >)
        at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:475)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:499)
        ...
Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:bb94:4e7c8ccc:6495 status: ActionStatus.ABORT_ONLY >
        at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:956)
        at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:752)
        ...
18:36:45,219 INFO  [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=null[severity=(WARN 1), summary=(Transaction failed), detail=(Transaction failed)]
{code}

This is related to a change in EPP datasource configuration in _gatein-ds.xml_ (_local-tx-datasource_ in EPP 5.2.0.ER01 vs. _no-tx-datasource_ in EPP 5.1.1.GA). Changing the datasource type in _gatein-ds.xml_ back to _no-tx-datasource_ works as a workaround.

Comment 1 Miroslav Cupák 2011-09-23 20:37:05 UTC
Full log attached.

Comment 2 Miroslav Cupák 2011-09-23 20:37:05 UTC
Attachment: Added: datasource.log


Comment 3 Miroslav Cupák 2011-09-23 20:40:16 UTC
Link: Added: This issue is related to JBQA-5399


Comment 4 Matt Wringe 2011-10-06 18:04:42 UTC
This is probably because the local-tx-datasource does not support two phase commits, while the no-tx-datasource doesn't take part in the transactions. See http://community.jboss.org/wiki/ConfigDataSources and http://docs.jboss.org/jbossas/docs/Administration_And_Configuration_Guide/5/html/Configuring_JDBC_DataSources.html
[there also might be an issue with local-tx-datasources and having multiple datasources specified]

It looks like we need to have an xa-datasource instead

I can't seem to find specific information in the documentation to really say what exactly is the reason we can't use the local-tx-datasource in our situation.




Comment 6 Marko Strukelj 2011-10-18 16:45:41 UTC
I changed gatein-idm back to no-tx-datasource, which fixes the problem as no-tx-datasource is isolated from JTA transaction management.

Comment 10 Jared MORGAN 2011-11-22 23:14:42 UTC
Release Notes Docs Status: Added: Needs More Info
Release Notes Text: Added: CAUSE:

CONSEQUENCE:

FIX:

RESULT:
Primary SME: Added: theute
NEEDINFO: Removed: Nobody Added: Subject Matter Expert


Comment 12 Thomas Heute 2011-11-23 06:45:00 UTC
Release Notes Docs Status: Removed: Needs More Info Added: Not Required


Comment 13 Jared MORGAN 2011-11-23 23:47:31 UTC
Release Notes Text: Removed: CAUSE:

CONSEQUENCE:

FIX:

RESULT: 
NEEDINFO: Removed: Subject Matter Expert