简体   繁体   English

JMeter IBM MQ JMS点对点测试获取NumberFormatException

[英]JMeter IBM MQ JMS Point-to-Point test getting NumberFormatException

I need to run a throughput benchmark test on IBM MQ 8.0.0.4. 我需要在IBM MQ 8.0.0.4上运行吞吐量基准测试。 I installed JMeter 3.0 and followed the instructions given here and here and here (don't ave enough points to post the third link). 我安装了JMeter 3.0,并按照此处此处以及此处给出的说明进行操作(不要发布足够多的点来发布第三个链接)。 I resolved all of the ClassNotFound errors by adding jars to the lib/ext directory (springcore, springframework (jms and beans), javax (jms and resource), ibm mq, ibm mqjms, jmeter jms skip, dhbcore). 我通过将jar添加到lib / ext目录(springcore,springframework(jms和beans),javax(jms和resource),ibm mq,ibm mqjms,jmeter jms skip,dhbcore)解决了所有ClassNotFound错误。

I am getting a NumberFormatException on the transportType attribute (set to "CLIENT"). 我在transportType属性上获取NumberFormatException(设置为“CLIENT”)。 I have exhausted all searches for a resolution -- any help would be greatly appreciated. 我已经用尽所有搜索的决议 - 任何帮助将不胜感激。

Here is the configuration of the Sampler: 以下是采样器的配置:

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="3.1" jmeter="3.1 r1770033">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="MQ Benchmark" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">10</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1480739219000</longProp>
        <longProp name="ThreadGroup.end_time">1480739219000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <JMSSampler guiclass="JMSSamplerGui" testclass="JMSSampler" testname="JMS Point-to-Point" enabled="true">
          <stringProp name="JMSSampler.queueconnectionfactory">CONNECTION_FACTORY</stringProp>
          <stringProp name="JMSSampler.SendQueue">Q.RQST</stringProp>
          <stringProp name="JMSSampler.ReceiveQueue">Q.RECV</stringProp>
          <boolProp name="JMSSampler.isFireAndForget">false</boolProp>
          <boolProp name="JMSSampler.isNonPersistent">false</boolProp>
          <boolProp name="JMSSampler.useReqMsgIdAsCorrelId">true</boolProp>
          <stringProp name="JMSSampler.timeout">100000</stringProp>
          <stringProp name="HTTPSamper.xml_data">This is a test message</stringProp>
          <stringProp name="JMSSampler.initialContextFactory">com.elega9t.jmeter.jms.InitialContextFactory</stringProp>
          <stringProp name="JMSSampler.contextProviderUrl"></stringProp>
          <elementProp name="JMSSampler.jndiProperties" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
            <collectionProp name="Arguments.arguments">
              <elementProp name="channel" elementType="Argument">
                <stringProp name="Argument.name">channel</stringProp>
                <stringProp name="Argument.value">TEST.SVRCONN</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="hostName" elementType="Argument">
                <stringProp name="Argument.name">hostName</stringProp>
                <stringProp name="Argument.value">redacted</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="port" elementType="Argument">
                <stringProp name="Argument.name">port</stringProp>
                <stringProp name="Argument.value">1414</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="queueManager" elementType="Argument">
                <stringProp name="Argument.name">queueManager</stringProp>
                <stringProp name="Argument.value">redacted</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="transportType" elementType="Argument">
                <stringProp name="Argument.name">transportType</stringProp>
                <stringProp name="Argument.value">CLIENT</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="java.naming.security.principal" elementType="Argument">
                <stringProp name="Argument.name">java.naming.security.principal</stringProp>
                <stringProp name="Argument.value">redacted</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="java.naming.security.credentials" elementType="Argument">
                <stringProp name="Argument.name">java.naming.security.credentials</stringProp>
                <stringProp name="Argument.value">redacted</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="queue.Q.RQST" elementType="Argument">
                <stringProp name="Argument.name">queue.Q.RQST</stringProp>
                <stringProp name="Argument.value">TEST.MQ.REQUEST</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="queue.Q.RECV" elementType="Argument">
                <stringProp name="Argument.name">queue.Q.RECV</stringProp>
                <stringProp name="Argument.value">TEST.MQ.RECEIVE</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
            </collectionProp>
          </elementProp>
        </JMSSampler>
        <hashTree/>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

Here's the output: 这是输出:

[root@jspqbusisa12 bin]# ./jmeter -n -t JMS_Point_to_Point_TEST.jmx

Writing log file to: /usr/local/apache-jmeter-3.0/bin/jmeter.log
Creating summariser <summary>
Created the tree successfully using JMS_Point_to_Point_TEST.jmx
Starting the test @ Wed Dec 07 10:35:50 EST 2016 (1481124950312)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary =     10 in 00:00:00 =   51.8/s Avg:     0 Min:     0 Max:     1 Err:    10 (100.00%)
Tidying up ...    @ Wed Dec 07 10:35:50 EST 2016 (1481124950643)
... end of run

Here's the jmeter.log: 这是jmeter.log:

2016/12/07 10:35:49 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US
2016/12/07 10:35:49 INFO  - jmeter.JMeter: Loading user properties from: /usr/local/apache-jmeter-3.0/bin/user.properties
2016/12/07 10:35:49 INFO  - jmeter.JMeter: Loading system properties from: /usr/local/apache-jmeter-3.0/bin/system.properties
2016/12/07 10:35:49 INFO  - jmeter.JMeter: Copyright (c) 1998-2016 The Apache Software Foundation
2016/12/07 10:35:49 INFO  - jmeter.JMeter: Version 3.0 r1743807
2016/12/07 10:35:49 INFO  - jmeter.JMeter: java.version=1.7.0_80
2016/12/07 10:35:49 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM
2016/12/07 10:35:49 INFO  - jmeter.JMeter: os.name=Linux
2016/12/07 10:35:49 INFO  - jmeter.JMeter: os.arch=amd64
2016/12/07 10:35:49 INFO  - jmeter.JMeter: os.version=2.6.32-279.el6.x86_64
2016/12/07 10:35:49 INFO  - jmeter.JMeter: file.encoding=UTF-8
2016/12/07 10:35:49 INFO  - jmeter.JMeter: Max memory     =515375104
2016/12/07 10:35:49 INFO  - jmeter.JMeter: Available Processors =8
2016/12/07 10:35:49 INFO  - jmeter.JMeter: Default Locale=English (United States)
2016/12/07 10:35:50 INFO  - jmeter.JMeter: JMeter  Locale=English (United States)
2016/12/07 10:35:50 INFO  - jmeter.JMeter: JMeterHome=/usr/local/apache-jmeter-3.0
2016/12/07 10:35:50 INFO  - jmeter.JMeter: user.dir  =/usr/local/apache-jmeter-3.0/bin
2016/12/07 10:35:50 INFO  - jmeter.JMeter: PWD       =/usr/local/apache-jmeter-3.0/bin
2016/12/07 10:35:50 INFO  - jmeter.JMeter: IP: 10.98.169.85 Name: jspqbusisa12 FullName: jspqbusisa12
2016/12/07 10:35:50 INFO  - jmeter.JMeter: user.classpath=/usr/local/apache-jmeter-3.0/lib/ext
2016/12/07 10:35:50 INFO  - jmeter.JMeter: Adding to classpath and loader: /usr/local/apache-jmeter-3.0/lib/ext
2016/12/07 10:35:50 INFO  - jmeter.services.FileServer: Default base='/usr/local/apache-jmeter-3.0/bin'
2016/12/07 10:35:50 INFO  - jmeter.services.FileServer: Set new base='/usr/local/apache-jmeter-3.0/bin'
2016/12/07 10:35:50 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2016/12/07 10:35:50 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8
2016/12/07 10:35:50 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.9
2016/12/07 10:35:50 INFO  - jmeter.save.SaveService: All converter versions present and correct
2016/12/07 10:35:50 INFO  - jmeter.save.SaveService: Loading file: JMS_Point_to_Point_TEST.jmx
2016/12/07 10:35:50 INFO  - jmeter.JMeter: Creating summariser <summary>
2016/12/07 10:35:50 INFO  - jmeter.engine.StandardJMeterEngine: Running the test!
2016/12/07 10:35:50 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: []
2016/12/07 10:35:50 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: []
2016/12/07 10:35:50 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.'
2016/12/07 10:35:50 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must not contain the string: '.gui.'
2016/12/07 10:35:50 INFO  - jmeter.JMeter: Running test (1481124950446)
2016/12/07 10:35:50 INFO  - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2016/12/07 10:35:50 INFO  - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2016/12/07 10:35:50 INFO  - jmeter.engine.StandardJMeterEngine: Thread will continue on error
2016/12/07 10:35:50 INFO  - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false
2016/12/07 10:35:50 INFO  - jmeter.threads.ThreadGroup: Started thread group number 1
2016/12/07 10:35:50 INFO  - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2016/12/07 10:35:50 INFO  - jmeter.threads.JMeterThread: Thread started: Thread Group 1-1
2016/12/07 10:35:50 ERROR - jmeter.protocol.jms.sampler.JMSSampler: For input string: "CLIENT" java.lang.NumberFormatException: For input string: "CLIENT"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:492)
        at java.lang.Integer.parseInt(Integer.java:527)
        at com.elega9t.jmeter.jms.InitialContextFactory$1.lookup(InitialContextFactory.java:56)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:329)
        at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:647)
        at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:996)
        at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:978)
        at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:616)
        at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:604)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:237)
        at java.lang.Thread.run(Thread.java:745)

2016/12/07 10:35:50 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times
2016/12/07 10:35:50 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2016/12/07 10:35:50 INFO  - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true
2016/12/07 10:35:50 INFO  - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000
2016/12/07 10:35:50 WARN  - jmeter.protocol.jms.sampler.JMSSampler: Session may not be null while creating message java.lang.IllegalStateException: Session may not be null while creating message
        at org.apache.jmeter.protocol.jms.sampler.JMSSampler.createMessage(JMSSampler.java:189)
        at org.apache.jmeter.protocol.jms.sampler.JMSSampler.sample(JMSSampler.java:145)
        at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465)
        at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241)
        at java.lang.Thread.run(Thread.java:745)
...
(( and then 9 more of these for each request submitted ))
...
2016/12/07 10:35:50 INFO  - jmeter.threads.JMeterThread: Thread is done: Thread Group 1-1
2016/12/07 10:35:50 INFO  - jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1
2016/12/07 10:35:50 INFO  - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2016/12/07 10:35:50 INFO  - jmeter.reporters.Summariser: summary =     10 in 00:00:00 =   51.8/s Avg:     0 Min:     0 Max:     1 Err:    10 (100.00%)

Any help would be appreciated -- I can't find any report of this issue and assume I'm doing something fundamentally wrong. 任何帮助将不胜感激 - 我找不到任何关于这个问题的报告,并假设我做了一些根本错误的事情。

The knowledge center for MQ v8.0 documents the numeric value of the constant WMQ_CM_CLIENT is 1. MQ v8.0的知识中心记录了常量WMQ_CM_CLIENT的数值为1。

I would suggest you try setting the transportType attribute to the number 1 instead of the word CLIENT . 我建议你尝试将transportType属性设置为数字1而不是单词CLIENT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM