Service Virtualization

Expand all | Collapse all

IBM MQ service virtualization – Getting Error  “java.lang.NoClassDefFoundError: com/ibm/mq/MQException”

Jump to Best Answer
  • 1.  IBM MQ service virtualization – Getting Error  “java.lang.NoClassDefFoundError: com/ibm/mq/MQException”

    Posted 08-17-2018 09:18 AM

    I have developed virtual service using request and response pairs and two Proxy Queues.

     

    I am using Devtest 10.1 and IBM MQ Manager running on 8.X version.

     

    I have placed below jar files in my local while developing the service to connect the MQ Manager and able to connect successfully.

     

     

    • com.ibm.mq.allclient.jar -
    • com.ibm.mq.commonservices.jar
    • com.ibm.mq.headers.jar
    • com.ibm.mq.jar
    • com.ibm.mq.jmqi.jar
    • com.ibm.mq.pcf.jar
    • com.ibm.mqjms.jar

     

    But when I placed these jar files into devtest server side and tried to deploy the virtual service.

     

    Once I deploy the service, I logged into the portal and find the errors against the deployed service and it was going offline once errors reached to more than 200.

     

    Error:

    ============================================================================

    | Exception:

    ============================================================================

    | Message:     Test Execution Stopped due to exception

    ----------------------------------------------------------------------------

    | Trapped Exception: com/ibm/mq/MQException

    | Trapped Message:   java.lang.NoClassDefFoundError: com/ibm/mq/MQException

    ----------------------------------------------------------------------------

    STACK TRACE

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

                    at com.itko.lisa.messaging.providers.ibmmq.IbmMqQueueManagerAsset.createInstance(IbmMqQueueManagerAsset.java:270)

                    at com.itko.lisa.messaging.providers.ibmmq.IbmMqQueueManagerAsset.createInstance(IbmMqQueueManagerAsset.java:65)

                    at com.itko.lisa.asset.LocalAssetRuntime$InstanceEntry.open(LocalAssetRuntime.java:2320)

                    at com.itko.lisa.asset.LocalAssetRuntime$InstanceEntry.checkOut(LocalAssetRuntime.java:1539)

                    at com.itko.lisa.asset.LocalAssetRuntime$RuntimeEntry.checkOut(LocalAssetRuntime.java:803)

                    at com.itko.lisa.asset.LocalAssetRuntime.doOpenAsset(LocalAssetRuntime.java:166)

                    at com.itko.lisa.asset.LocalAssetRuntime.openAssetInScope(LocalAssetRuntime.java:123)

                    at com.itko.lisa.asset.LocalAssetRuntime.openAsset(LocalAssetRuntime.java:114)

                    at com.itko.lisa.messaging.providers.ibmmq.IbmMqQueueAsset.createInstance(IbmMqQueueAsset.java:234)

                    at com.itko.lisa.messaging.providers.ibmmq.IbmMqQueueAsset.createInstance(IbmMqQueueAsset.java:43)

                    at com.itko.lisa.asset.LocalAssetRuntime$InstanceEntry.open(LocalAssetRuntime.java:2320)

                    at com.itko.lisa.asset.LocalAssetRuntime$InstanceEntry.checkOut(LocalAssetRuntime.java:1539)

                    at com.itko.lisa.asset.LocalAssetRuntime$RuntimeEntry.checkOut(LocalAssetRuntime.java:803)

                    at com.itko.lisa.asset.LocalAssetRuntime.doOpenAsset(LocalAssetRuntime.java:166)

                    at com.itko.lisa.asset.LocalAssetRuntime.openAssetInScope(LocalAssetRuntime.java:123)

                    at com.itko.lisa.asset.LocalAssetRuntime.openAssetInScope(LocalAssetRuntime.java:121)

                    at com.itko.lisa.asset.LocalAssetRuntime.openAsset(LocalAssetRuntime.java:114)

                    at com.itko.lisa.messaging.providers.ibmmq.IbmMqGetOperation.executeSync(IbmMqGetOperation.java:1128)

                    at com.itko.lisa.messaging.providers.ibmmq.IbmMqGetOperation.doExecute2(IbmMqGetOperation.java:914)

                    at com.itko.lisa.messaging.providers.ibmmq.IbmMqGetOperation.doExecute2(IbmMqGetOperation.java:78)

                    at com.itko.lisa.asset.operation.AbstractRetryableRuntimeOperation.doExecute(AbstractRetryableRuntimeOperation.java:30)

                    at com.itko.lisa.asset.operation.AbstractRuntimeOperation.execute(AbstractRuntimeOperation.java:167)

                    at com.itko.lisa.messaging.providers.ibmmq.IbmMqGetOperation.executePrepareOnly(IbmMqGetOperation.java:892)

                    at com.itko.lisa.messaging.builder.AbstractMultiReceiveOperation.doExecute(AbstractMultiReceiveOperation.java:417)

                    at com.itko.lisa.asset.operation.AbstractRuntimeOperation.execute(AbstractRuntimeOperation.java:167)

                    at com.itko.lisa.asset.operation.AbstractOperationStep.execute(AbstractOperationStep.java:176)

                    at com.itko.lisa.asset.operation.AbstractOperationStep.execute(AbstractOperationStep.java:125)

                    at com.itko.lisa.messaging.vse.AbstractVseListenStep.execute(AbstractVseListenStep.java:53)

                    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)

                    at com.itko.lisa.test.TestCase.execute(TestCase.java:1294)

                    at com.itko.lisa.test.TestCase.execute(TestCase.java:1198)

                    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1183)

                    at com.itko.lisa.test.TestCase.executeTest(TestCase.java:1124)

                    at com.itko.lisa.coordinator.Instance.run(Instance.java:204)

    Caused by: java.lang.ClassNotFoundException: com.ibm.mq.MQException

                    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

                    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

                    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

                    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

                    ... 34 more

     

    Question: is there any additional jar files are required?



  • 2.  Re: IBM MQ service virtualization – Getting Error  “java.lang.NoClassDefFoundError: com/ibm/mq/MQException”

    Posted 08-17-2018 09:58 AM

    According to the IBM support website IBM Java MQException Class moved to the com.ibm.mq.jmqi.jar file in MQ V7 - United States  that class is in com.ibm.mq.jmqi.jar

     

    The error you pasted claims that it can't find that class, I presume it means that it hasn't been loaded. The MQ JARs all need to be in DEVTEST_HOME/lib/shared, and DevTest loads JARs from there at start-up, so have you restarted your VSE server process since copying the MQ files to the correct place, and did you copy the correct (MQ v7+) versions of those files?

     

    If you've done all the above, look in the vse.log file on the server to see why the class hasn't loaded.



  • 3.  Re: IBM MQ service virtualization – Getting Error  “java.lang.NoClassDefFoundError: com/ibm/mq/MQException”

    Posted 08-17-2018 10:10 AM

    Sorry I forgot to mention this.

     

    I have placed the jar files into DEVTEST_HOME/lib/shared and DEVTEST_HOME/lib/core and bounce back the server.

     

    https://docops.ca.com/devtest-solutions/10-1/en/administering/general-administration/third-party-file-requirements#Third-PartyFileRequirements-WebSphereMQFileRequirements

     

    I have gone through the above document and I have placed the jar files which was listed under "WebSphere MQ 8".

     

    Thanks,

    Venu



  • 4.  Re: IBM MQ service virtualization – Getting Error  “java.lang.NoClassDefFoundError: com/ibm/mq/MQException”

    Posted 08-17-2018 12:11 PM

    Try to just put the MQ jars in DEVTEST_HOME/lib folder. And make sure you place these jars on all servers that requires it. For example, if you are executing an MQ test case with a Simulator then you need to place the jar files on the Simulator server installation. Or if you have a virtual service that uses the MQ jars then you need to place the jar files on the VSE server installation.



  • 5.  Re: IBM MQ service virtualization – Getting Error  “java.lang.NoClassDefFoundError: com/ibm/mq/MQException”

    Posted 08-21-2018 02:17 PM

    thanks for your reply...

    I have placed below jar files(MQ 8.x) in VSE server4 and restated the VSE server.

    • com.ibm.mq.allclient.jar -
    • com.ibm.mq.commonservices.jar
    • com.ibm.mq.headers.jar
    • com.ibm.mq.jar
    • com.ibm.mq.jmqi.jar
    • com.ibm.mq.pcf.jar
    • com.ibm.mqjms.jar

     

    I am using Devtest 10.1.0..

     

    after restarting the server, I am seeing below error in portal.

    An error occurred while retrieving the list of VSE servers.

     

    log details are as below.

    Registry:
    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is java.util.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: Provider com.ibm.mq.jmqi.CustomCharsetProvider not a subtype
     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
     ... 42 more
    Caused by: java.util.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: Provider com.ibm.mq.jmqi.CustomCharsetProvider not a subtype

     

    Portal:
    2018-08-21 18:10:04,562Z (11:10) [qtp2126706339-19] ERROR org.grails.web.errors.GrailsExceptionResolver - RetrofitError occurred when processing request: [GET] /devtest/api/sv/vseServers/name,%20performanceEnabled/all
    503 Service Unavailable. Stacktrace follows:
    retrofit.RetrofitError: 503 Service Unavailable

     

     



  • 6.  Re: IBM MQ service virtualization – Getting Error  “java.lang.NoClassDefFoundError: com/ibm/mq/MQException”
    Best Answer

    Posted 08-22-2018 09:21 AM

    we got a solution from CA support team.

     

    The following JAR files are required for WebSphere MQ 8:

    com.ibm.mq.allclient.jar

    com.ibm.mq.commonservices.jar

     

    After removing the additional jars we were able start the portal fine.

     

    Thank,

    Venu