使用JNDI在Tomcat上设置WMQ V8连接工厂 [英] WMQ V8 Connection Factory setup on Tomcat using JNDI

查看:124
本文介绍了使用JNDI在Tomcat上设置WMQ V8连接工厂的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我们基于JNDI的Tomcat配置基于当前有效的建议.

Currently on our Tomcat configuration with JNDI is based on this recommendation which currently is working.

如何使用以下方法连接到Websphere MQ(MQ系列)服务器JMS和JNDI?

由于我们要升级到v8,所以我想利用JMS 2.0功能.这将需要将jar文件更新为JMS 2.0版本.

Since we are upgrading to v8 I would like to take advantage of the JMS 2.0 features. This would require updating the jar files to the JMS 2.0 versions.

因此,我从tomcat lib文件夹中删除了以下jar.

So I have removed the following jars from the tomcat lib folder.

  • com.ibm.mq.jar
  • com.ibm.mqjms.jar
  • connector.jar
  • dhbcore.jar
  • geronimo-j2ee-management_1.0_spec-1.0.jar
  • geronimo-jms_1.1_spec-1.0.jar

并用这些罐子代替它们.基于此链接

And replaced them with these jars. Base on this link

  • com.ibm.mq.allclient.jar
  • com.ibm.mq.traceControl.jar

我的JNDI配置与此配置匹配.

My JNDI configuration matches this configuration.

<Resource
      name="jms/MyQCF"
      auth="Container"
      type="com.ibm.mq.jms.MQQueueConnectionFactory"
      factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
      description="JMS Queue Connection Factory for sending messages"
      HOST="<mymqserver>"
      PORT="1414"
      CHAN="<mychannel>"
      TRAN="1"
      QMGR="<myqueuemanager>"/>

现在有了更新的jar文件,我遇到了以下异常.

Now with the updated jar files I'm getting the following exceptions.

Caused by: java.lang.NoClassDefFoundError: javax/jms/JMSRuntimeException
    at com.ibm.mq.jms.MQQueueConnectionFactoryFactory.getObjectInstance(MQQueueConnectionFactoryFactory.java:69)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:141)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:842)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:117)
    at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
    at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:34)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:138)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:110)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:82)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
    at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:724)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 7 more

问题:

我应该在类路径中包含另一个jar文件吗?

Should I be including another jar file to the class path?

还是针对v8更改了JNDI的配置?

Or has the configuration of JNDI changed for v8?

推荐答案

不要 尝试添加在MQ安装中找到的JMS Jar. IBM从v8.0开始已打包JMS,因此现在支持jar文件的独立安装.但是,仅当您使用完整且完整的罐子集且切勿随意混合和匹配它们时.这样做是鲁re的,不明智的.

Please do NOT try adding the JMS Jar found in the MQ installation. IBM has as of v8.0 repackaged JMS so that a stand-alone install of the jar files is now supported. But only if you use the complete and intact set of jars and do not mix and match them on a whim. To do so would be reckless and ill-advised.

您处在正确的轨道上,但是出于您的目的,我会从解释安装过程的技术说明尝试一下.

You are on the right track but for your purposes I would go grab the file from the latest 8.0.0.x MQ Client Fix Pack. I would then go to the Technote that explains the install procedure and try that.

我确定IBM有一个从服务器安装中获取jar的过程,但是由于这些jar的包装方式似乎不同,因此我将钱花在为独立交付而设计和测试的软件包上.我上面链接到的那个.

I'm sure that IBM has a process for grabbing jars from the server install, however since these appear to be packaged differently, I'd put my money on the package designed and tested for stand-alone delivery - e.g. the one I linked to above.

顺便说一句,由于现在不支持此功能,因此您可以打开PMR,告诉IBM您已按照信中的指示进行操作,并逐步解决了该问题. (然后在此处发布修复问题的方法.)但是如果您只是随机获取jar文件并希望它能工作,他们将不会这样做.

By the way, since this is now supported if it doesn't work you can open a PMR, tell IBM you followed their instructions to the letter, and make them walk through fixing it with you. (Then post here what it was that fixed it.) But they won't do that if you just go grabbing random jar files and hope it works.

这篇关于使用JNDI在Tomcat上设置WMQ V8连接工厂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆