-
Bug
-
Resolution: Won't Do
-
Major
-
EAP_EWP 5.2.0 ER2, EAP_EWP 5.2.0 ER5, EAP_EWP 5.2.0 ER6
-
None
-
TCK5 run
-
Workaround Exists
-
-
Documented as Known Issue
-
NEW
Calling createConnection() method of Websphere MQ resource adapter implementation of QueueConnectionFactory and TopicConnectionFactory with or without parameters always leads to exception
88 tests in TCK affected.
see
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP5/view/IBM-MQ/job/tck5-eap5x-jdk6-jms-ibmmq/19/testReport/unknownTestSuite.0/
Impact for customers
It's impossible to get connection in some cases.
Reproducer info
Failed test org.jboss.as.test.ibm.mq.tck.GetConnectionFromQueueConnectionTestCase in
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP5/view/IBM-MQ/job/_eap5-ibm-mq-tck-failures-reproducers/
Link to reproducers execution:
https://docspace.corp.redhat.com/docs/DOC-124332#rep
Links for info how to setup IBM MQ locally
https://docspace.corp.redhat.com/docs/DOC-114804#qi
More detailed description
Trying to execute this fragment leads to exception:
MQJCA1026:Invalid operation for a domain specific object.
Context context = new InitialContext(); QueueConnectionFactory cf = (QueueConnectionFactory) context.lookup("jms/QCF"); Queue queue = (Queue) context.lookup(QUEUE_1); qCon = cf.createConnection();
This is also true for TopicConnectionFactory implementation.
Due to investigation of people from Spring https://jira.springsource.org/browse/SPR-9877?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab, it's caused by wrong implementation:
We recompile the connector classes com.ibm.mq.connector.jar (same as mqconnector.jar)(sorry to IBM), find:
QueueConnectionFactoryImpl.class
public Connection createConnection() throws JMSException { return createConnection(null, null); } public Connection createConnection(String username, String password) throws JMSException { if (ResourceAdapterImpl.getJCARuntimeHelper().getEnvironment() != 1) { return createQueueConnection(username, password); } throw ((JMSException)JCAExceptionBuilder.buildException(3, "MQJCA1026")); }
But due to implementation, expression ResourceAdapterImpl.getJCARuntimeHelper().getEnvironment() always returns 1.
As a workarond in TCK run we used Byteman script, that doesn't allow to throw this Exception.
RULE enable QCF CLASS com.ibm.mq.connector.outbound.QueueConnectionFactoryImpl METHOD createConnection(java.lang.String, java.lang.String) AT ENTRY BIND qcf=$0 IF TRUE DO traceln("!!!!!!!!!!call workaround QCF!!!"); return qcf.createQueueConnection($1, $2) ENDRULE RULE enable TCF CLASS com.ibm.mq.connector.outbound.TopicConnectionFactoryImpl METHOD createConnection(java.lang.String, java.lang.String) AT ENTRY BIND tcf=$0 IF TRUE DO traceln("!!!!!!!!!!call workaround TCF!!!"); return tcf.createTopicConnection($1, $2) ENDRULE
After this rule application, the method should look like this
public Connection createConnection(String username, String password) throws JMSException { return createQueueConnection(username, password); }
Connection factories in *-ds.xml file for these tests were created this way:
<connection-factories> <tx-connection-factory> <jndi-name>jms/QCF</jndi-name> <xa-transaction /> <rar-name>wmq.jmsra.rar</rar-name> <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> <config-property name="channel" type="java.lang.String">CH</config-property> <config-property name="hostName" type="java.lang.String">dev120.mw.lab.eng.bos.redhat.com</config-property> <config-property name="port" type="java.lang.String">1414</config-property> <config-property name="queueManager" type="java.lang.String">QM</config-property> <config-property name="transportType" type="java.lang.String">CLIENT</config-property> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory> <tx-connection-factory> <jndi-name>jms/TCF</jndi-name> <xa-transaction /> <rar-name>wmq.jmsra.rar</rar-name> <connection-definition>javax.jms.TopicConnectionFactory</connection-definition> <config-property name="channel" type="java.lang.String">CH</config-property> <config-property name="hostName" type="java.lang.String">dev120.mw.lab.eng.bos.redhat.com</config-property> <config-property name="port" type="java.lang.String">1414</config-property> <config-property name="queueManager" type="java.lang.String">QM</config-property> <config-property name="transportType" type="java.lang.String">CLIENT</config-property> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory> </connection-factories/>
- is related to
-
JBEAP-2337 Calling createConnection() method of Websphere MQ resource adapter implementation of QueueConnectionFactory and TopicConnectionFactory throws Exception with code MQJCA1026
- Resolved