title: WMQ V8 Connection Factory setup on Tomcat using JNDI
body: <p>Currently on our Tomcat configuration with JNDI is based on this recommendation which currently is working.</p>
  
  <p><a href="http://wiki.apache.org/tomcat/HowTo#How_do_I_connect_to_a_Websphere_MQ_.28MQ_Series.29_server_using_JMS_and_JNDI.3F" rel="nofollow">How do I connect to a Websphere MQ (MQ Series) server using JMS and JNDI?</a></p>
  
  <p>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.</p>
  
  <p>So I have removed the following jars from the tomcat lib folder. </p>
  
  <ul>
  <li>com.ibm.mq.jar</li>
  <li>com.ibm.mqjms.jar</li>
  <li>connector.jar</li>
  <li>dhbcore.jar</li>
  <li>geronimo-j2ee-management_1.0_spec-1.0.jar</li>
  <li>geronimo-jms_1.1_spec-1.0.jar</li>
  </ul>
  
  <p>And replaced them with these jars.  Base on this <a href="http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q030590_.htm" rel="nofollow">link</a></p>
  
  <ul>
  <li>com.ibm.mq.allclient.jar</li>
  <li>com.ibm.mq.traceControl.jar</li>
  </ul>
  
  <p>My JNDI configuration matches this configuration.</p>
  
  <pre><code>&lt;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="&lt;mymqserver&gt;"
        PORT="1414"
        CHAN="&lt;mychannel&gt;"
        TRAN="1"
        QMGR="&lt;myqueuemanager&gt;"/&gt;
  </code></pre>
  
  <p>Now with the updated jar files I'm getting the following exceptions.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Questions:</p>
  
  <p>Should I be including another jar file to the class path?</p>
  
  <p>Or has the configuration of JNDI changed for v8?</p>