In this post, we will see about the common errors you encounter in SOAP over JMS protocol in HP LoadRunner or JMeter.
Sanity checks:
Ensure that you have associated all the latest JARs in HP LoadRunner/Apache JMeter. You can get the relevant JARs from the development team or you can download it from http://www.findjar.com/index.x
To associate JARs in HP LoadRunner, go to Replay > Runtime Settings or press F4 key, and then click on Advanced tab under JMS as shown below.
Enter the full path of JARs in Classpath text field with semicolon separated or you simply enter %CLASSPATH% and map the JARs in your computer’s environment variables.
To map the JARs in JMeter, click on Test Plan and click on Browse button to map all the JARs as shown below.
Most of the errors that you encounter during unit testing can be solved by mapping right set of JARs and mention right send/receive queue names in the HP LoadRunner or Apache JMeter.
Now we will see about the common errors:
- Error: Failed to send message with javax.naming.NameNotFoundException
This error can be solved easily. The common mistake that testers do is mapping the wrong queue name in the script. Check for the right queue and map it accordingly to the script.
- naming.InvalidNameException
You get javax.naming.InvalidNameException when the port number is invalid, you need to check for the correct port and append it in the set property name.
- naming.AuthenticationException
You get javax.naming.AuthenticationException error when the JMS username and password is incorrect. Please check for any extra spaces in the username/password. You can get the username from the TIBCO configuration as well.
- Incorrect Initial Context Factory
Always make sure that you select appropriate initial context factory details in the settings. E.g. by default you can select com.tibco.tibjms.naming.TibjmsInitialContextFactory from the dropdown as shown below.
I am trying to send messages to ActiveMQ which is running on my local machine using Loadrunner webservices protocol. When I execute below function, getting ClassNotFoundException:
jms_send_message_queue(“Msg1”, “This message sent from Loadrunner tool”, “Queue1”);
Error message:
Action.c(4): JMS call “Msg1” started
Action.c(4): jms_print_general_property – JVM_Path = C:\Program Files (x86)\Micro Focus\LoadRunner\bin\..\lib\openjdk32\jre\
Action.c(4): jms_print_general_property – JMS_impl_classpath = C:\Users\semandi\OneDrive – Infor\Downloads\All_Required_JAR_Files\activemq-all-5.15.0.jar
Action.c(4): jms_set_general_property called – JNDI_InitialContextFactory = org.activemq.jndi.ActiveMQInitialContextFactory
Action.c(4): jms_set_general_property called – JNDI_provider_URL = http://localhost:8161/
Action.c(4): jms_set_general_property called – ConnectionFactory = ConnectionFactory
Action.c(4): jms_set_general_property called – connections_per_process = 1
Action.c(4): jms_set_general_property called – msg_timeout = 1
Action.c(4): jms_set_general_property called – user_define_timeout = 20
Action.c(4): jms_set_general_property called – SecurityPrincipal = admin
Action.c(4): jms_set_general_property called – SecurityCredentials = admin
Action.c(4): jms_set_general_property called – SetCorbaOrb =
Action.c(4): jms_set_general_property called – auto_generate_selector = 0
Action.c(4): jms_set_general_property called – EnableTibcoSslJndiLookup =
Action.c(4): java.naming.provider.url = http://localhost:8161/
Action.c(4): java.naming.factory.initial = org.activemq.jndi.ActiveMQInitialContextFactory
Action.c(4): java.naming.security.principal=admin
Action.c(4): java.naming.security.credentials=admin
Action.c(4): Error: Failed to send message This message sent from Loadrunner tool to Queue1 due to the following exception : javax.naming.NoInitialContextException: Cannot instantiate class: org.activemq.jndi.ActiveMQInitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.activemq.jndi.ActiveMQInitialContextFactory]
javax.naming.NoInitialContextException: Cannot instantiate class: org.activemq.jndi.ActiveMQInitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.activemq.jndi.ActiveMQInitialContextFactory]
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:719)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.InitialContext.(InitialContext.java:208)
at com.mercury.ws.jms.ConnectionManagerImpl.initialize(ConnectionManagerImpl.java:98)
at com.mercury.ws.jms.JMSSupportImpl.initialize(JMSSupportImpl.java:28)
at com.mercury.ws.jms.JMSBridge.init_jms(JMSBridge.java:154)
Caused by: java.lang.ClassNotFoundException: org.activemq.jndi.ActiveMQInitialContextFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:374)
at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:107)
at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:82)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:716)
… 6 more
Action.c(4): Error: JMS call execution failed
I tried placing activemq-all-5.15.0.jar in JVM Paths. still same error. What is the default ClassPath in Loadrunner settings and Are there any other jar files I need to place in JVM_path. Could you please help.