title: Weblogic JMS binding issue, class could not be initialized exception
body: <p>Could not initialize class exception is coming when trying to view the jndi bindings for a JMS destination in Weblogic 12c server. I have setup JMS modules with JMS destination queues and connection factory. Below are the things that is deployed in the server :</p>
  
  <pre><code> JMS Module : MyAppJmsModule (JMSSystemResource)
   JMS Server : MyAppJMSServer (Foreign Server)
   JNDI Initial Context Factory: com.sun.jndi.fscontext.RefFSContextFactory
   JNDI Connection URL: file:///abc/oracle/config/domains/domain_test/jms/MyAppJmsModule/MyAppJMSServer/jms 
   In the above path lies the .bindings file
  
   Destination tab showing Name, Local JNDI name and Remote JNDI name correctly.
   Connection Factories tab also showing the jndi names correctly.
   Local jndi name is prefixed with jms/
  </code></pre>
  
  <p>Now when I am clicking on the destination inside the JNDI Tree, it gives me the below error:</p>
  
  <pre><code>Unexpected exception: failed to load return type: class java.lang.Object; nested exception is: java.lang.ClassNotFoundException: Failed to load class com.ibm.mq.jms.MQQueue
  </code></pre>
  
  <p>Error from weblogic log :</p>
  
  <pre><code>An error was generated by the RMI server:
      weblogic.jndi.internal.RootNamingNode.lookup(Ljava.lang.String;Ljava.util.Hashtable;)
  
  
  java.lang.NoClassDefFoundError: Could not initialize class com.ibm.mq.jms.MQXAQueueConnectionFactory.
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:264)
      at com.ibm.mq.jms.MQXAQueueConnectionFactoryFactory.class$(MQXAQueueConnectionFactoryFactory.java:58)
      at com.ibm.mq.jms.MQXAQueueConnectionFactoryFactory.getObjectInstance(MQXAQueueConnectionFactoryFactory.java:58)
      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
  </code></pre>
  
  <p>Successful JNDI binding should show something like this :</p>
  
  <pre><code> Binding Name:      jms.QUEUENAME
   Class:             com.ibm.mq.jms.MQQueue
   Hash Code:         Some Value
   toString Results:  queue://QUEUEMGR/APP.QUEUENAME?persistence=2&amp;expiry=0
  </code></pre>
  
  <p>I have deployed an appplication which got deployed successfully but in warning state. When I checked the monitoring tab for the application it is showing the below error :</p>
  
  <pre><code>Symtom{MDB,MEDIUM,MyApp-0.0.1-SNAPSHOT,MDB application MyApp-0.0.1-SNAPSHOT is NOT connected to messaging system.}
  </code></pre>
  
  <p>I have checked few of the classes that got loaded and I found the below relevant classes that is being displayed in application classpath :</p>
  
  <pre><code>~/application/config/com.ibm.mq-9.0.0.jar
  ~/application/config/com.ibm.mq.headers.jar
  ~/application/config/com.ibm.mq.jmqi-9.0.0.jar
  ~/application/config/com.ibm.mq.pcf-6.1.jar
  ~/application/config/com.ibm.mqjms-9.0.0.jar
  ~/application/config/commons-codec-1.10.jar
  ~/application/config/dhbcore.jar
  ~/application/config/fscontext.jar
  ~/application/config/javaee-api-5.jar
  ~/application/config/jms.jar
  ~/application/config/jndi.jar
  ~/application/config/providerutil.jar
  </code></pre>
  
  <blockquote>
    <p>Please help me to find out what is I am missing in my configurations.</p>
  </blockquote>