Switchyard JCA Reference Binding and IBM MQ
ravi21588 Apr 1, 2016 7:36 AMHi All,
Iam facing issue with JCA Reference binding while connecting to IBM MQ.the JCA service binding is working as expected and picking message from MQ.
I had created two admin objects with below details :
1.)
JNDI: java:/jcaservice
Class Name: com.ibm.mq.connector.outbound.MQQueueProxy
2.)
JNDI: java:/jcareference
Class Name: com.ibm.mq.connector.outbound.MQQueueProxy
Iam trying to develop a switchyard component with JCA Service and JCS Reference
JCA Service :
<sca:service name="JCAService" promote="Component2/JCAService">
<sy:interface.esb inputType="java.lang.String"/>
<jca:binding.jca name="jca">
<jca:inboundConnection>
<jca:resourceAdapter name="wmq.jmsra.rar"/>
<jca:activationSpec>
<jca:property name="destinationType" value="javax.jms.Queue"/>
<jca:property name="destination" value="jcaservice"/>
</jca:activationSpec>
</jca:inboundConnection>
<jca:inboundInteraction>
<jca:listener>javax.jms.MessageListener</jca:listener>
<jca:endpoint type="org.switchyard.component.jca.endpoint.JMSEndpoint"/>
</jca:inboundInteraction>
</jca:binding.jca>
</sca:service>
JCA Reference:
<sca:reference name="JCAReference" multiplicity="0..1" promote="Component2/JCAReference">
<sy:interface.esb inputType="java.lang.String"/>
<jca:binding.jca name="jca">
<jca:outboundConnection>
<jca:resourceAdapter name="wmq.jmsra.rar"/>
<jca:connection jndiName="java:jboss/MQConnectionFactory"/>
</jca:outboundConnection>
<jca:outboundInteraction>
<jca:processor type="org.switchyard.component.jca.processor.JMSProcessor">
<jca:property name="destination" value="jcareference"/>
<jca:property name="messageType" value="Text"/>
</jca:processor>
</jca:outboundInteraction>
</jca:binding.jca>
</sca:reference>
I can see the JMS Service is listening to the queue.
iam getting below error in logs when i send message to jcaservice :
Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSMQ1113: The destination does not have a name set.
An attempt was made to use a MQQueue or MQTopic that was created with the default constructor. A name should have then been set before the queue was used.
After creation set a name on the MQQueue or MQTopic.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_80]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_80]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_80]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_80]
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)
at com.ibm.mq.jms.MQDestination.validateDestination(MQDestination.java:1654)
at com.ibm.mq.jms.MQSession.createProducer(MQSession.java:683)
at com.ibm.mq.connector.outbound.MessageProducerWrapper.<init>(MessageProducerWrapper.java:104)
at com.ibm.mq.connector.outbound.SessionWrapper.createProducer(SessionWrapper.java:375)
at org.switchyard.component.jca.processor.JMSProcessor.process(JMSProcessor.java:147) [switchyard-component-jca-1.1.1-p5-redhat-1.jar:1.1.1-p5-redhat-1]
... 252 more
can anyone please help.