Websphere MQ integration
simondelfab Nov 12, 2012 2:24 AMHi All,
I been trying to get JBoss 7.1.1.Final to connect to Websphere MQ these last couple of days and I encountered an error which I just can't seem to Google myself out of.
The exception I get is this:
com.ibm.msg.client.jms.DetailedJMSException: MQJCA1026: An operation on a domain specific object was not valid. A JMS application attempted to perform an operation on a domain specific object, but the operation is valid only on cross domain objects or in the other messaging domain. Make sure that the JMS objects used by your application are relevant to the required messaging domain.
16:51:49,818 ERROR [stderr] (http--0.0.0.0-443-1) at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:141)
A few other people have encountered the same problem:
https://community.jboss.org/thread/161447
Configure JBoss, I followed:
There is other dated reference sources which I encountered as well:
https://access.redhat.com/knowledge/ja/node/88823
https://community.jboss.org/wiki/WebsphereMQIntegration
https://community.jboss.org/wiki/JBossEAP5IntegrationWithWebSphereMQ
My standalone.xml looks like this:
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
<resource-adapters>
<resource-adapter>
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>NoTransaction</transaction-support>
<config-property name="traceLevel">
8
</config-property>
<config-property name="traceEnabled">
true
</config-property>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl" jndi-name="TSCF" enabled="true" use-java-context="true" pool-name="TSCF">
<config-property name="port">
1414
</config-property>
<config-property name="username">
root
</config-property>
<config-property name="queueManager">
TSDEV
</config-property>
<config-property name="hostName">
myhost
</config-property>
<config-property name="channel">
some.CHANNEL
</config-property>
<config-property name="password">
mypassword
</config-property>
<config-property name="transportType">
BINDINGS
</config-property>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="QUEUE.NAME" enabled="true" use-java-context="true" pool-name="TSDEV">
<config-property name="baseQueueName">
QUEUE.NAME
</config-property>
<config-property name="baseQueueManagerName">
TSDEV
</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
<resource-adapter>
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>NoTransaction</transaction-support>
<config-property name="traceLevel">
8
</config-property>
<config-property name="traceEnabled">
true
</config-property>
<admin-objects>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="LFTLFT" enabled="true" use-java-context="true" pool-name="TSDEV">
<config-property name="baseQueueName">
LFTLFT
</config-property>
<config-property name="baseQueueManagerName">
TSDEV
</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
</resource-adapters>
....
I have tried both CLIENT and BINDINGS transport types.
Side question: the XML schema suggests I can have multiple admin-object elements under admin-objects, but when I do that, JBoss fails to run. Says unexpected element config-property.
I have bumped up the trace level and I have attached the trace file. Apart from the warning "Distributed transactions are not available in client mode.", everything looks to proceeding along normally until the exception.
In regards to the actual exception, the documentation doesn't appear to be helpful:
"Make sure that the JMS objects used by your application are relevant to the required messaging domain."
From my understanding, this means that you should only try to establish a connection to queue/topic using the appropriate connection factories. That is, don't try creating a topic connection to a queue and vice versa. Or use the wrong JMS objects with either a topic or queue connection. I don't believe I am doing that!
Digging down further into the Websphere MQ code, the exception is raised if WASSupport.getEnvironment() returns something != 1. So in the queue connection factory class there is this:
public Connection createConnection(String username, String password)
throws JMSException
{
if (ResourceAdapterImpl.getJCARuntimeHelper().getEnvironment() != 1) {
return createQueueConnection(username, password);
}
throw ((JMSException)JCAExceptionBuilder.buildException(3, "MQJCA1026"));
}
and in WASSupport.getEnvironment() there is some reflection going on. But it pretty much always returns 1 (unless it can dynamically load the class com.ibm.ws.util.PlatformHelper and execute some method).
So I am completely stumped as to what the cause of the problem is and I would greatly appreciate any suggestions.
Regards,
Simon
-
mqjms_3201.trc.zip 15.1 KB