我正在尝试连接到Websphere app Server 7.0中定义的MQ连接工厂.
但我找不到一个正确的connectionfactory接口供MQ在Spring中定义.
但是当我尝试在spring配置文件中硬编码连接细节时,我能够连接到队列管理器.
在Spring bean中使用什么正确的接口/格式来加载在Websphere appl服务器中定义的MQ连接工厂?
工作守则
不工作的代码
diobjectfactorybean">
其中WASQM是Websphere中定义的MQ连接工厂
非工作代码出错
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
最佳答案
正确的方法是
>在Websphere App Server中的队列连接工厂中创建资源(不在连接工厂中)
>使用javax.jms.QueueConnectionFactory作为spring config中的连接工厂
diobjectfactorybean">
这个page给了我一些暗示.