Created attachment 791725 [details] patch Description of problem: During TIBCO EMS certification we use generic resource adapter(https://github.com/jbertram/generic-jms-ra). Sometimes in test case we need to use XAConnectionFactory instance for non-transaction environement or operation. Current version of generic RA doesn't allow this both for inbound and outgoing connections. Version-Release number of selected component (if applicable): EAP 6.1.1.ER7 How reproducible: easy Steps to Reproduce: inbound: try to use MDB with no transaction support and XAConnectionFactory for endpoint activation. Due to TIBCO EMS implementation you'll get e.g. java.lang.ClassCastException: com.tibco.tibjms.naming.TibjmsFederatedXAConnectionFactory cannot be cast to javax.jms.ConnectionFactory outgoing: when XAConnectionFactory is used for message delivery, resource adapter always returns transactional session, even if we try to get non-transactional one. Both problems lead to TCK tests failures. Please, make appropriate changes in resource adapter code. Applied patch can be used to fix this issue.
Please, don't apply patch. Seems, that MDBs don't work correctly this way. But we still need a fix to use XAConnections in non-transactional operations.
which tck tests highlight this issue?
This part: https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP6/view/EAP6-TIBCO-EMS/job/tibco-ems-EAP6.x-tck6-jms-matrix/10/MODULE=all,jdk=java16_default,label=RHEL6/testReport/unknownTestSuite.0/packageTests/com.sun.ts.tests.jms.ee.all.queuetests/ and all MDB tests
I changed a bit configuration in com.sun.ts.tests.jms.ee.all.queuetests to pass this test (you can see it in setup script as #workaround). To pass MDB tests I changed RA code. Original RA fails on MDB deployment.
This issue does not appear now. Vladmir can you point out what was changed, please? Thanks, Mirek
Mirek, the generic JMS RA has been updated to 1.0.1.Final with a fix for this issue: https://github.com/jms-ra/generic-jms-ra/commit/b2d96fe15168d07c2debb2c23c42b93de1aec4ea
Thanks Jeff for info. Setting bz as verified since related TCK tests are passing.
Re-opening. Fix for this issue was reverted in tag 1.0.3.Final to fix bz#1033008. This is more problem on Tibco side as their XAConnectionFactory does not extend ConnectionFactory. See related jiras. [1][2] Problem is that this will be hard requirement in JMS 2.0 spec and we should try to handle this case. Following TCK tests fail because of it: com/sun/ts/tests/jms/ee/mdb/xa/MDBClient.java#Test4 com/sun/ts/tests/jms/ee/mdb/xa/MDBClient.java#Test5 com/sun/ts/tests/jms/ee/mdb/xa/MDBClient.java#Test6 com/sun/ts/tests/jms/ee/mdb/xa/MDBClient.java#Test8 com/sun/ts/tests/jms/ee/mdb/xa/MDBClient.java#Test9 @Jeff In server log this is exception: 11:07:40,060 ERROR [org.jboss.resource.adapter.jms.inflow.JmsActivation] (default-threads - 1) Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@33935a68(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@75c5f1fb destination=TCK.Q3 destinationType=javax.jms.Queue acknowledgeMode=Auto-acknowledge subscriptionDurability=false reconnectInterval=10 reconnectAttempts=-1 user=null maxMessages=1 minSession=1 maxSession=15 connectionFactory=XACF jndiParameters={java.naming.provider.url=tcp://dev134.mw.lab.eng.bos.redhat.com:7222, java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory}): java.lang.ClassCastException: com.tibco.tibjms.naming.TibjmsFederatedXAConnectionFactory cannot be cast to javax.jms.ConnectionFactory at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupConnection(JmsActivation.java:428) [generic-jms-ra-jar-1.0.2.Final.jar:1.0.3.Final-SNAPSHOT] at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupConnection(JmsActivation.java:398) [generic-jms-ra-jar-1.0.2.Final.jar:1.0.3.Final-SNAPSHOT] at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupActivation(JmsActivation.java:302) [generic-jms-ra-jar-1.0.2.Final.jar:1.0.3.Final-SNAPSHOT] at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:253) [generic-jms-ra-jar-1.0.2.Final.jar:1.0.3.Final-SNAPSHOT] I've checked the code and there problem is in JmsActivation.setupConnection:420- "if (preliminaryObject instanceof XAConnectionFactory && isDeliveryTransacted) {" where isDeliveryTransacted is set to false and preliminaryObject (which implements XAConnectionFactory) is then cast to ConnectionFactory which fails with above ClassCastException. Can we just return normal javax.jms.Connection when preliminaryObject is instance of XAConnectionFactory and isDeliveryTransacted is set to false. Related Jenkins job: https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP6/view/EAP6-TIBCO-EMS/job/tibco-ems-EAP6.x-tck6-jms-matrix-clone/ [1] https://java.net/jira/browse/GENERICJMSRA-55 [2] https://java.net/jira/browse/JMS_SPEC-71
These TCK tests failed before Generic JMS RA 1.0.3.Final (and even before 1.0.2.Final). e.g. https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP6/view/EAP6-TIBCO-EMS/job/tibco-ems-EAP6.x-tck6-jms-matrix/MODULE=mdb,jdk=java16_default,label=non-vmware/ I suspect the failures are due to a change in the TCK setup as they appeared after https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP6/view/EAP6-TIBCO-EMS/job/tibco-ems-EAP6.x-tck6-jms-matrix/MODULE=mdb,jdk=java16_default,label=non-vmware/26/
At this moment there no class cast exception but: 07:29:20,167 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri] (default-threads - 4) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: java.lang.IllegalArgumentException: Invalid acknowledge mode value 0 at org.jboss.resource.adapter.jms.JmsManagedConnection.<init>(JmsManagedConnection.java:191) at org.jboss.resource.adapter.jms.JmsManagedConnectionFactory.createManagedConnection(JmsManagedConnectionFactory.java:109) at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:842) at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:386) at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:404) at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:372) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:353) at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:488) at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.allocateConnection(JmsSessionFactoryImpl.java:362) at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createQueueSession(JmsSessionFactoryImpl.java:149) at com.sun.ts.tests.jms.common.ParentMsgBeanNoTx.onMessage(ParentMsgBeanNoTx.java:113) [mdb_msg_ejb.jar:] This happens when session is created with transacted false and session transacted mode: connection.createSession(false,0); We have to document this issue to release notes: "When a session is created in a transaction context like: connection.createSession(false,0); an IllegalArgumentException occurs. Root cause is that generic RA does not ignore parameters passed to createSession where first sets session not transacted and second to mode transacted session (0). Workaround is to create transacted session: connection.createSession(true,0);
Removed component 'doc-release-notes' as this is not a bug with the Release Notes document. Reset Assignee to default for component. Leaving requires_doc_text flag as is to ensure entry in future release notes. The Target Release needs to be populated for this release note to appear in the appropriate Release Notes document (NEEDIINFO).
There is no requirements for TIBCO to be able to use XAConnectionFactory for non-transacted operations in JMS 1.1. The solution is clear and simple: use a regular connection factory for non XA transacted operations and use a XA Connection factory for XA operations.
This issue is not blocker. Relying on a XAConnectionFactory to perform non-transacted operation is not correct and the root error comes from TIBCO.
Removing blocker flag. This will be documented in Release Notes for EAP 6.3.0.