Configuring WMQ V8 Factory on Tomcat using JNDI

Our Tomcat configuration with JNDI is currently based on this recommendation, which is currently working.

How do I connect to a WebSphere MQ server (MQ Series) using JMS and JNDI?

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

So, I removed the following jars from 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 they replaced them with these banks. Basics on this link

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

My JNDI config matches this config.

<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>"/>

      

Now with the updated jar files, I am 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

      

Questions:

Should I include another jar file in the classpath?

Or has JNDI config changed for v8?

+3


source to share


1 answer


Please do NOT attempt to add the JMS Jar found in the MQ installation. IBM has reprogrammed JMS v8.0 so that offline installation of jar files is now supported. But only if you use a full and undamaged set of cans and don't mix or agree with them on a whim. Doing so would be reckless and dishonest.

You are on the right track, but for my purposes I would take the file with the latest 8.0.0.x MQ Client Fix Pack . Then I'll go to Technote explaining the installation procedure and try this.

Screen shot showing new v8.0 MQ "Java All" distribution package.



I'm sure IBM has a process for grabbing cans from a server setup, however, since they appear to be packaged in different ways, I would put my money on a package designed and tested for offline delivery - like the one I linked to above.

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

+3


source







All Articles