1
votes

jmeter (jms point-to-point) error while connecting IBM - MQ :

javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory

Need help in resolving the error. FYI: com.ibm.mq.allclient.jar is added in lib folder, 32 bit jdk 1.8

jms point-to-point configuration in jemeter

JNDI configuration in mq explorer

After adding the jars (copied all the MQ Jars (that comes with a complete Websphere MQ installation) and placing them into JMeter/Lib) new error encountered:

Error: Response message: java.lang.IllegalStateException: QueueConnectionFactory expected, but got com.ibm.mq.jms.MQConnectionFactory

Binding file is there in place (C:\Users*****\Downloads\apache-jmeter-3.3\apache-jmeter-3.3\JNDI-Directory)

3
Hi, welcome to stack overflow. Please refer the How to Ask link for more details on how to ask a question and update your question accordingly.Jeroen Heier
JoshMc - I have updated the question.shubham sachan
Note once you get to 15 reputation you have the ability to upvote answers to any question including your own. If the answers I linked to by @AttilaRepasi also helped you then it would be a nice gesture to go and upvote them.JoshMc

3 Answers

1
votes

You do not state which version of IBM MQ jar files you are using, however com.ibm.mq.allclient.jar was introduced in IBM MQ v8, so you must be using v8 or v9.


The v9 Knowledge Center page "What is installed for IBM MQ classes for JMS" states the following:

The fscontext.jar and providerutil.jar files are required if your application performs JNDI lookups using a file system context.


In summary you need to include the following jar files:

  • com.ibm.mq.allclient.jar
  • jms.jar
  • fscontext.jar
  • providerutil.jar

See my answer to "Upgrade of Java 8 and MQ - NoClassDEfFoundError for more information.


UPDATE 2018-01-25

Related to the secondary error:

Error: Response message: java.lang.IllegalStateException: QueueConnectionFactory expected, but got com.ibm.mq.jms.MQConnectionFactory

In the following answer Attila Repasi addresses the error you are receiving:

JMeter 3.2 Point-to-Point configuration for IBM MQ 8 => Java Exception

The answer states:

Create a MQQueueConnectionFactory in MQExplorer instead of the MQConnectionFactory you have now.

In addition in the following answer Attila Repasi describes how to configure JMeter with IBM MQ v8 and addresses what to do in MQ Explorer.

JMeter configuration for IBM MQ 8

0
votes

According to oracle post you are missing fscontext.jar

the ClassNotFoundException for com.sun.jndi.fscontext.RefFSContextFactory is solved by adding fscontext.jar to your classpath

You can download it here and copy it to JMeter lib folder

0
votes

You need to either drop required libraries somewhere under JMeter Classpath or set user.classpath property to point to the folder where they live.

According to Getting the IBM MQ classes for Java and JMS:

.\JavaSE:

com.ibm.mq.

allclient.jar

com.ibm.mq.traceControl.jar

fscontext.jar

jms.jar

providerutil.jar

JSON4J.jar

So you need not only allclient.jar, you need all the jars from the JavaSE folder.

More information: IBM MQ testing with JMeter - Learn How