Service Virtualization

 View Only
  • 1.  Class not found error while connecting to MQ

    Posted Jul 06, 2016 04:56 PM

    I am trying to put a message into a MQ queue. When I run it, I see the below error.

     

    java.lang.NoClassDefFoundError: com/ibm/mq/MQException

     

    What causes to trigger this error and how can this be fixed..?



  • 2.  Re: Class not found error while connecting to MQ
    Best Answer

    Posted Jul 06, 2016 05:06 PM

    If you're using MQ 7.0 or later, then MQException is in the jar file com.ibm.mq.jmqi.jar.  First, can you make sure that this jar is present in DEVTEST_HOME/lib/shared/, along with the rest of the MQ client jars?

     

    Generally, NoClassDefFoundError means the class file was actually found on your classpath, but an error occured initializing the class.  A lot of times this is because another class is missing, but the NoClassDefFoundError itself isn't going to have any details.  Whatever went wrong with initializing the MQException class has already occurred.

     

    Can you check your workstation log?  Find where that NoClassDefFoundError is, and then look above that in the log for previous errors.



  • 3.  Re: Class not found error while connecting to MQ

    Posted Jul 12, 2016 05:09 PM

    Thanks for the reply Kevin. It took me almost a week to get the client JARs to my desktop, but that worked.



  • 4.  Re: Class not found error while connecting to MQ

    Posted Jul 12, 2016 11:36 AM

    Hi ngs72712,

     

    Did any of Kevin's suggestions help to answer your question? If so, please be sure to mark his answer as correct and share here which suggestion helped!

     

    Thanks,

    Melanie