I have standard Spring JMS config
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="defaultDestination" ref="jmsdestination" />
</bean>
<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jms/MQAuditQueueConnectionFactory" />
</bean>
<bean id="jmsDestinationResolver" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jms/MQAuditQueue" />
</bean>
And I think a standard MQ on WAS 8.5.5.2, when I start my web-app I get:
Cannot convert value of type [com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory'
I note from my server I have the following classes in the following jars
class com/ibm/ejs/jms/JMSQueueConnectionFactoryHandle.class found in /opt/websphere/was8//plugins/com.ibm.ws.runtime.jar
and
com/ibm/mq/jms/MQQueueConnectionFactory.class found in /opt/websphere/was8//installedConnectors/wmq.jmsra.rar/com.ibm.mqjms.jar
How do I get the WAS MQ to use the 2nd jar?
After lots of trial and error I found the answer is to exclude the jms-api which comes with spring-jms, in your pom.xml.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
</exclusion>
</exclusions>
</dependency>