Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT Connect Sampler show 500 error #33

Closed
andyzhouh opened this issue Apr 11, 2018 · 6 comments
Closed

MQTT Connect Sampler show 500 error #33

andyzhouh opened this issue Apr 11, 2018 · 6 comments

Comments

@andyzhouh
Copy link

andyzhouh commented Apr 11, 2018

/home/test/桌面/jietu.png
打印消息如下:
2018/04/11 10:01:18 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2018/04/11 10:01:18 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2018/04/11 10:01:18 INFO - net.xmeter.samplers.ConnectionSampler: *** Keeptime is: 1800
2018/04/11 10:01:18 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,local)
2018/04/11 10:01:18 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : 线程组
2018/04/11 10:01:18 INFO - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group 线程组.
2018/04/11 10:01:18 INFO - jmeter.engine.StandardJMeterEngine: Thread will continue on error
2018/04/11 10:01:18 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false
2018/04/11 10:01:18 INFO - jmeter.threads.ThreadGroup: Started thread group number 1
2018/04/11 10:01:18 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2018/04/11 10:01:18 INFO - jmeter.threads.JMeterThread: Thread started: 线程组 1-1
2018/04/11 10:01:18 ERROR - net.xmeter.samplers.ConnectionSampler: String index out of range: -10 java.lang.StringIndexOutOfBoundsException: String index out of range: -10
at java.lang.String.substring(String.java:1911)
at net.xmeter.Util.generateClientId(Util.java:34)
at net.xmeter.samplers.ConnectionSampler.sample(ConnectionSampler.java:62)
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:748)

2018/04/11 10:01:18 ERROR - jmeter.samplers.SampleResult: setEndTime must be called after setStartTime java.lang.Throwable: Invalid call sequence
at org.apache.jmeter.samplers.SampleResult.setEndTime(SampleResult.java:1046)
at org.apache.jmeter.samplers.SampleResult.sampleEnd(SampleResult.java:1085)
at net.xmeter.samplers.ConnectionSampler.sample(ConnectionSampler.java:93)
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:748)

2018/04/11 10:01:18 INFO - net.xmeter.samplers.ConnectionSampler: Created the sampler results, will sleep current thread for 1800 sceconds
2018/04/11 10:01:18 INFO - net.xmeter.samplers.ConnectionSampler: Connection is null.
2018/04/11 10:01:18 INFO - jmeter.threads.JMeterThread: Thread is done: 线程组 1-1
2018/04/11 10:01:18 INFO - jmeter.threads.JMeterThread: Thread finished: 线程组 1-1
2018/04/11 10:01:18 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2018/04/11 10:01:18 INFO - net.xmeter.samplers.ConnectionSampler: in testEnded, isNonGUI=false, sleepFlag=false
2018/04/11 10:01:18 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(false,local)
jietu

@falalawang
Copy link

此错误由于ClinetId过长导致,此插件设定的最大的ClientId长度为23。

@andyzhouh
Copy link
Author

好的,我把clientid长度改为23位以内了,已经没有报这个错误了,但是又出现了新的错误,错误信息如下:
2018/04/11 12:28:28 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2018/04/11 12:28:28 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2018/04/11 12:28:28 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,local)
2018/04/11 12:28:28 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Ïß³Ì×é
2018/04/11 12:28:28 INFO - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group Ïß³Ì×é.
2018/04/11 12:28:28 INFO - jmeter.engine.StandardJMeterEngine: Thread will continue on error
2018/04/11 12:28:28 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false
2018/04/11 12:28:28 INFO - jmeter.threads.ThreadGroup: Started thread group number 1
2018/04/11 12:28:28 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2018/04/11 12:28:28 INFO - jmeter.threads.JMeterThread: Thread started: Ïß³Ì×é 1-1
2018/04/11 12:28:29 INFO - net.xmeter.samplers.ConnectionCallback: The connection org.fusesource.mqtt.client.CallbackConnection@16e612cfhawtdispatch-DEFAULT-2 is established successfully.
2018/04/11 12:28:29 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoSuchMethodError: org.apache.jmeter.samplers.SampleResult.setSentBytes(J)V
at net.xmeter.samplers.PubSampler.sample(PubSampler.java:227)
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:748)

2018/04/11 12:28:29 INFO - jmeter.threads.JMeterThread: Thread finished: Ïß³Ì×é 1-1
2018/04/11 12:28:29 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2018/04/11 12:28:29 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(false,local)
2018/04/11 12:28:29 INFO - net.xmeter.samplers.PubSampler: The connection org.fusesource.mqtt.client.CallbackConnection@16e612cf disconneted successfully.

2.为什么结果树下没有对应的MQTT Pub Sampler对应的信息,如下:
catch7cb3 04-11-14-17-38

@falalawang
Copy link

Hi Andy,

第一个错误是由于Jmeter3.0版本低,内部方法不兼容造成的。我们建议您使用JMeter3.2或3.3版本。 后续我们会更新对JMeter版本限制的说明。
第二个错误是由于第一个错误抛出异常后,写sampler result失败导致从结果树中看不到结果。更换JMeter版本后问题就可以解决。

Thanks

@andyzhouh
Copy link
Author

感谢,我试一下Jmeter更高的版本。

@andyzhouh
Copy link
Author

用jmeter2.0的版本,可以正常发布消息。

@falalawang
Copy link

好的,现在的v1.0版本的MQTT是基于ApacheJMeter_core v3.1 编译的,所以如果用比较老的jmeter版本执行可能会出现一些问题,所以还是建议使用JMeter 3.1以上版本比较保险。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants