我试图在非gui中运行简单的jMeter测试,我使用的是一个简单的命令:
jmeter -n -t davelatal-cz.jmx -Jusers=4 -Jduration=300
我改变了主题偏好设置,如下面的截图所示: Thread Preferences
因此,如果我尝试运行这个简单的HTTP请求测试,bash会向我显示此错误:
Error in NonGUIDriver java.lang.NullPointerException
截图:
这是LOG文件:
2017/09/19 08:05:15 INFO - jmeter.util.JMeterUtils: Setting Locale to cs_CZ
2017/09/19 08:05:15 ERROR - jmeter.util.JMeterUtils: Could not find resources for 'cs_CZ'
2017/09/19 08:05:15 INFO - jmeter.JMeter: Loading user properties from: /usr/share/jmeter/bin/user.properties
2017/09/19 08:05:15 INFO - jmeter.JMeter: Loading system properties from: /usr/share/jmeter/bin/system.properties
2017/09/19 08:05:15 INFO - jmeter.JMeter: Setting JMeter property: users=4
2017/09/19 08:05:15 INFO - jmeter.JMeter: Setting JMeter property: duration=300
2017/09/19 08:05:15 INFO - jmeter.JMeter: Copyright (c) 1998-2014 The Apache Software Foundation
2017/09/19 08:05:15 INFO - jmeter.JMeter: Version 2.11.20151206
2017/09/19 08:05:15 INFO - jmeter.JMeter: java.version=1.8.0_131
2017/09/19 08:05:15 INFO - jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM
2017/09/19 08:05:15 INFO - jmeter.JMeter: os.name=Linux
2017/09/19 08:05:15 INFO - jmeter.JMeter: os.arch=amd64
2017/09/19 08:05:15 INFO - jmeter.JMeter: os.version=4.4.0-43-Microsoft
2017/09/19 08:05:15 INFO - jmeter.JMeter: file.encoding=UTF-8
2017/09/19 08:05:15 INFO - jmeter.JMeter: Default Locale=čeština (Česká republika)
2017/09/19 08:05:15 INFO - jmeter.JMeter: JMeter Locale=čeština (Česká republika)
2017/09/19 08:05:15 INFO - jmeter.JMeter: JMeterHome=/usr/share/jmeter
2017/09/19 08:05:15 INFO - jmeter.JMeter: user.dir =/mnt/c/Users/latal/Documents/Nigga
2017/09/19 08:05:15 INFO - jmeter.JMeter: PWD =/mnt/c/Users/latal/Documents/Nigga
2017/09/19 08:05:15 INFO - jmeter.JMeter: IP: 127.0.1.1 Name: J5MPJ72 FullName: J5MPJ72.bscpraha.cz
2017/09/19 08:05:15 INFO - jmeter.services.FileServer: Default base='/mnt/c/Users/latal/Documents/Nigga'
2017/09/19 08:05:15 INFO - jmeter.services.FileServer: Set new base='/mnt/c/Users/latal/Documents/Nigga'
2017/09/19 08:05:15 INFO - jmeter.JMeter: Loading file: davelatal-cz.jmx
2017/09/19 08:05:15 INFO - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2017/09/19 08:05:15 INFO - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8
2017/09/19 08:05:15 INFO - jmeter.save.SaveService: Using SaveService properties version 2.6
2017/09/19 08:05:15 INFO - jmeter.save.SaveService: Using SaveService properties file version 1554411
2017/09/19 08:05:15 INFO - jmeter.save.SaveService: All converter versions present and correct
2017/09/19 08:05:15 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration' : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
---- Debugging information ----
message : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
cause-exception : com.thoughtworks.xstream.converters.reflection.MissingFieldException
cause-message : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
class : org.apache.jmeter.samplers.SampleSaveConfiguration
required-type : org.apache.jmeter.samplers.SampleSaveConfiguration
converter-type : org.apache.jmeter.save.converters.SampleSaveConfigurationConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/ResultCollector/objProp/value/sentBytes
line number : 56
class[1] : org.apache.jmeter.testelement.property.ObjectProperty
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
class[2] : org.apache.jmeter.reporters.ResultCollector
converter-type[2] : org.apache.jmeter.save.converters.TestElementConverter
class[3] : org.apache.jorphan.collections.ListedHashTree
converter-type[3] : org.apache.jmeter.save.converters.HashTreeConverter
------------------------------- : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration' : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
---- Debugging information ----
message : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
cause-exception : com.thoughtworks.xstream.converters.reflection.MissingFieldException
cause-message : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
class : org.apache.jmeter.samplers.SampleSaveConfiguration
required-type : org.apache.jmeter.samplers.SampleSaveConfiguration
converter-type : org.apache.jmeter.save.converters.SampleSaveConfigurationConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/ResultCollector/objProp/value/sentBytes
line number : 56
class[1] : org.apache.jmeter.testelement.property.ObjectProperty
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
class[2] : org.apache.jmeter.reporters.ResultCollector
converter-type[2] : org.apache.jmeter.save.converters.TestElementConverter
class[3] : org.apache.jorphan.collections.ListedHashTree
converter-type[3] : org.apache.jmeter.save.converters.HashTreeConverter
-------------------------------
message : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration' : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
---- Debugging information ----
message : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
cause-exception : com.thoughtworks.xstream.converters.reflection.MissingFieldException
cause-message : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
class : org.apache.jmeter.samplers.SampleSaveConfiguration
required-type : org.apache.jmeter.samplers.SampleSaveConfiguration
converter-type : org.apache.jmeter.save.converters.SampleSaveConfigurationConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/ResultCollector/objProp/value/sentBytes
line number : 56
class[1] : org.apache.jmeter.testelement.property.ObjectProperty
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
class[2] : org.apache.jmeter.reporters.ResultCollector
converter-type[2] : org.apache.jmeter.save.converters.TestElementConverter
class[3] : org.apache.jorphan.collections.ListedHashTree
converter-type[3] : org.apache.jmeter.save.converters.HashTreeConverter
-------------------------------
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration' : No field 'sentBytes' found in class 'org.apache.jmeter.samplers.SampleSaveConfiguration'
first-jmeter-class : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:107)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.samplers.SampleSaveConfiguration
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/ResultCollector/objProp/value/sentBytes
line number : 56
version : 2.11.20151206
-------------------------------
2017/09/19 08:05:15 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.NullPointerException
at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:92)
at org.apache.jmeter.JMeter.runNonGui(JMeter.java:755)
at org.apache.jmeter.JMeter.startNonGui(JMeter.java:733)
at org.apache.jmeter.JMeter.start(JMeter.java:392)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.jmeter.NewDriver.main(NewDriver.java:259)
我已经尝试更改项目文件夹,谷歌但我在选项的最后。谁能告诉我我做错了什么?或问题出在哪里?
由于
答案 0 :(得分:0)
很可能你正在运行一个在JMeter 2.11上使用较新的JMeter版本创建的测试,所以我的期望是你需要升级你的JMeter。
当前的JMeter版本为JMeter 3.2。
您始终可以从JMeter Downloads页面获取最新的JMeter版本。
因此,我建议您从JMeter切换到您可以直接从Apache下载的二进制包,这些JMeter似乎是从Linux发行版存储库中获取的。只需拉出tarball,将其解压缩到某处并从该文件夹中运行JMeter。确保将Jmeter作为./jmeter
运行,或者将其添加到来自存储库的system PATH之前。