40231

How to resolve javax.naming.NameNotFoundException: com.ibm.mq.jms.MQQueueConnectionFactory error in

Question:

I am using JMeter to connect to Websphere MQ for placing multiple messages to the Queue. I have tried the below

<ol><li>

Downloaded the below jars into a separate path and enabled the user.classpath variable in jmeter.properties and appended the jars path to it

a) com.ibm.mq.jar

b) com.ibm.mqjms.jar

c) dhbcore.jar

d) fscontext.jar

e) javax.jms.jar

f) jms.jar

g) providerutil.jar

<ol start="2"><li>

Used JMS Publisher Sampler and have set the required details<a href="https://i.stack.imgur.com/XReMh.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/XReMh.png" data-original="https://i.stack.imgur.com/XReMh.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>

</li> <li>

Ran the Sampler and I am getting error as javax.naming.NameNotFoundException: com.ibm.mq.jms.MQQueueConnectionFactory <a href="https://i.stack.imgur.com/kBhTk.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/kBhTk.png" data-original="https://i.stack.imgur.com/kBhTk.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>

</li> </ol></li> </ol>

I have tried downloading multiple other jars as specified in different forums on the internet. None of them seems to resolve this issue. The class com.ibm.mq.jms.MQQueueConnectionFactory is indeed present in the MQ jars downloaded. Not sure why JMeter is unable to find this class.

Any help on this, please?

Answer1:

Wow. You are missing a bunch of MQ JAR files.

<blockquote>

e) javax.jms.jar

</blockquote>

That's not an MQ JAR file.

Here's the list of MQ JAR files that you need for MQ JMS Pub/Sub:

<ol><li>com.ibm.mq.commonservices.jar</li> <li>com.ibm.mq.headers.jar</li> <li>com.ibm.mq.jar</li> <li>com.ibm.mq.jmqi.jar</li> <li>com.ibm.mq.pcf.jar</li> <li>com.ibm.mqjms.jar</li> <li>connector.jar</li> <li>dhbcore.jar</li> <li>fscontext.jar</li> <li>jms.jar</li> <li>jndi.jar</li> <li>jta.jar</li> <li>ldap.jar</li> <li>providerutil.jar</li> <li>rmm.jar</li> </ol>

If you want to make your life easier, starting with MQ v8.0.0.4, there is an MQ JAR file called '<a href="http://www.ibm.com/support/docview.wss?uid=swg21683398" rel="nofollow">com.ibm.mq.allclient.jar</a>' that contains everything.

Answer2:

javax.naming.NameNotFoundException isn't anything to do with classes. If Java couldn't find the class then you'd get a ClassNotFoundException.

javax.naming.NameNotFoundException is a JNDI exception indicating that JNDI couldn't find anything with the name you passed in.

I expect the 'ConnectionFactory' field in the UI isn't looking for a class name, but is really looking for the JNDI name of the ConnectionFactory which you've configured with the required parameters to connect to your MQ queue manager. So an instance of MQQueueConnectionFactory rather than its class file.

Recommend

  • Advantages of spring batch [closed]
  • How to implement an Oracle AQ queue in Spring Boot?
  • IBM MQueue: setdirectAuth() operation is invalid error
  • Spring Bean Custom Scope JMS
  • Get queue name from message
  • Connection Failure Using Spring-JMS DefaultMessageListenerContainer cacheLevelName CACHE_NONE
  • How to install Symfony2 Bundles with Composer
  • What happened to JMS 1.1 in Maven Central?
  • How to share messages, published on Topic, between multiple VMs, in Spring Jms Tibjms
  • Implementing Publish Subscribe using Spring Integration JMS in ActiveMQ
  • Apache Ivy and configurations
  • How to modify inputKeys for a custom CIFilter?
  • Spring boot jar fails to start embedded server on adding tomcat-embed-jasper dependency
  • Spring DefaultMessageListenerContainer - listener not reading messages on Websphere MQ
  • Get channel table file from remote server
  • Impossible to inject JMS QueueConnectionFactory in JBoss 6.1.0 with resource annotation
  • How to set Context.INITIAL_CONTEXT_FACTORY? NoInitialContextException?
  • JMS Job queue with Grails
  • TSQL: Trigger on Commit
  • Spring DefaultMessageListenerContainer - listener not reading messages on Websphere MQ
  • Sonar Violation: Dodgy - Write to static field from instance method
  • WSO2 BAM with JMS
  • How to compare two different JSON response structure in java?
  • Oracle Data Change Notification Timeout and Workflow
  • Hibernate not creating Table automatically in spring boot using postgresql
  • JmsTemplate has no send timeout
  • How is logback's “prudent mode” implemented?
  • how to use jsr 223 preprocessor in jmeter? [closed]
  • How to design a distributed application using a Message Broker and a Database?
  • Is it possible to secure whole Controller in Symfony 2?
  • Algorithms that lead to java.lang.OutOfMemoryError: PermGen space error
  • EventBus on Android: how to implement dynamic queues vs. class-based event subscription?
  • Doctrine fixtures not working after updating to Symfony 2.1.8
  • What's effective way to write Vaadin project ?
  • Symfony2: how to get config parameters in Form classes
  • Ruby Mixins and Instance variables
  • SQL Server Replication : Removing broken subscriptions at the publisher
  • Pandas - 2 dataframes, add Index column of df1 to df2 on second column
  • NullPointer in Glassfish when inject JMS @Resource
  • How to distribute an event to all nodes in a (Wildfly) cluster?