How to jndi search for MQ factory connection defined in Spring's Websphere Server application

I am trying to connect to the factory MQ connection defined in WebSphere Server 7.0.

But I could not find the correct connectionfactory interface for defining MQ in Spring.

However, when I tried hard to set the connection data in the spring configuration file, I can connect to the queue manager.

What is the correct interface / format to use in spring beans to load the MQ factory connection defined on the Websphere application server?

Working code

<bean id="mqConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
    <property name="hostName">
        <value>127.0.0.1</value>
    </property>
    <property name="port">
        <value>1414</value>
    </property>
    <property name="queueManager">
        <value>MYQM</value>
    </property>
    <property name="transportType">
        <value>1</value>
    </property>
</bean>

Inoperative code

<bean id="mqConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="jms/WASQM"/>
    <property name="lookupOnStartup" value="false"/>
    <property name="cache" value="true" />
    <property name="proxyInterface"  value="com.ibm.mq.jms.MQQueueConnectionFactoryFactory" />
</bean>

where WASQM is the MQ factory connection defined in Websphere

Invalid code error

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mqConnectionFactory' defined in ServletContext resource [/WEB-INF/config/config-mq.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: [com.ibm.mq.jms.MQQueueConnectionFactoryFactory] is not an interface
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
Caused by: java.lang.IllegalArgumentException: [com.ibm.mq.jms.MQQueueConnectionFactoryFactory] is not an interface

I need help replacing broken code with the correct code. Spring - 3.0.5 IBM MQ and Application Web Servers - 7.0

+5
1

  • Queue Connection Factory Websphere ( Factory)
  • javax.jms.QueueConnectionFactory Factory spring config

    <bean id="mqConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
       <property name="jndiName" value="WASQM"/>
       <property name="lookupOnStartup" value="false"/>
       <property name="cache" value="true" />
       <property name="proxyInterface"  value="javax.jms.QueueConnectionFactory" />
    </bean>
    

.

+4

All Articles