【发布时间】:2017-03-02 14:42:15
【问题描述】:
我在 JMeter 中创建了一个负载测试来检索有效的访问令牌,然后对我的 webAPI 执行多个请求以测试在 JMeter 中工作的查询。
我的测试计划使用 JSONPathExtractor 插件从 JSON 响应中提取令牌,然后将该令牌存储为用于进行测试组的属性。 我想在 Visual Studio Team Services 中上传并运行这些 JMeter 测试,但是我收到“初始化测试运行时服务发生内部错误”。
这是从 VSTS 生成的日志文件:
2016/10/20 13:26:22 INFO - jmeter.util.JMeterUtils: Setting Locale to en_US
2016/10/20 13:26:22 INFO - jmeter.JMeter: Loading user properties from: C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.8\Downloads\0\approot\JMeterLoadTest\clt_jmeterdrop\bin\user.properties
2016/10/20 13:26:22 INFO - jmeter.JMeter: Loading system properties from: C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.8\Downloads\0\approot\JMeterLoadTest\clt_jmeterdrop\bin\system.properties
2016/10/20 13:26:23 INFO - jmeter.JMeter: Copyright (c) 1998-2015 The Apache Software Foundation
2016/10/20 13:26:23 INFO - jmeter.JMeter: Version 2.13 r1665067
2016/10/20 13:26:23 INFO - jmeter.JMeter: java.version=1.8.0_60
2016/10/20 13:26:23 INFO - jmeter.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM
2016/10/20 13:26:23 INFO - jmeter.JMeter: os.name=Windows Server 2012 R2
2016/10/20 13:26:23 INFO - jmeter.JMeter: os.arch=amd64
2016/10/20 13:26:23 INFO - jmeter.JMeter: os.version=6.3
2016/10/20 13:26:23 INFO - jmeter.JMeter: file.encoding=Cp1252
2016/10/20 13:26:23 INFO - jmeter.JMeter: Default Locale=English (United States)
2016/10/20 13:26:23 INFO - jmeter.JMeter: JMeter Locale=English (United States)
2016/10/20 13:26:23 INFO - jmeter.JMeter: JMeterHome=C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.8\Downloads\0\approot\JMeterLoadTest\clt_jmeterdrop
2016/10/20 13:26:23 INFO - jmeter.JMeter: user.dir =C:\Windows\system32
2016/10/20 13:26:23 INFO - jmeter.JMeter: PWD =C:\Windows\System32
2016/10/20 13:26:23 INFO - jmeter.JMeter: IP: 10.0.0.4 Name: vstsloadagent0 FullName: vstsloadagent0.oykuxugkk15uzmtpoj4pw2mxgh.fx.internal.cloudapp.net
2016/10/20 13:26:23 INFO - jmeter.services.FileServer: Default base='C:\Windows\system32'
2016/10/20 13:26:23 INFO - jmeter.services.FileServer: Set new base='d:\0\td\99ed1\TestRun\Out'
2016/10/20 13:26:23 INFO - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2016/10/20 13:26:23 INFO - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8
2016/10/20 13:26:23 INFO - jmeter.save.SaveService: Using SaveService properties file version 1656252
2016/10/20 13:26:23 INFO - jmeter.save.SaveService: Using SaveService properties version 2.8
2016/10/20 13:26:23 INFO - jmeter.save.SaveService: All converter versions present and correct
2016/10/20 13:26:23 INFO - jmeter.save.SaveService: Loading file: d:\0\td\99ed1\TestRun\Out\JMeter Tile Test (Complete).jmx
2016/10/20 13:26:23 INFO - jmeter.protocol.http.control.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_
2016/10/20 13:26:23 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default
2016/10/20 13:26:23 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is
2016/10/20 13:26:23 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is
2016/10/20 13:26:23 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is
2016/10/20 13:26:23 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is
2016/10/20 13:26:23 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2016/10/20 13:26:23 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'d:\0\td\99ed1\TestRun\Out\JMeter Tile Test (Complete).jmx', conversion error com.thoughtworks.xstream.converters.ConversionException: com/jayway/jsonpath/PathNotFoundException : com/jayway/jsonpath/PathNotFoundException
---- Debugging information ----
message : com/jayway/jsonpath/PathNotFoundException
cause-exception : java.lang.NoClassDefFoundError
cause-message : com/jayway/jsonpath/PathNotFoundException
first-jmeter-class : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:102)
class : org.apache.jmeter.save.ScriptWrapper
required-type : com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree[3]/hashTree/hashTree[3]/com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
line number : 118
version : 2.13 r1665067
-------------------------------
at org.apache.jmeter.save.SaveService.readTree(SaveService.java:586)
at org.apache.jmeter.save.SaveService.loadTree(SaveService.java:537)
at org.apache.jmeter.JMeter.runNonGui(JMeter.java:750)
at org.apache.jmeter.JMeter.startNonGui(JMeter.java:737)
at org.apache.jmeter.JMeter.start(JMeter.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:264)
Caused by: com.thoughtworks.xstream.converters.ConversionException: com/jayway/jsonpath/PathNotFoundException : com/jayway/jsonpath/PathNotFoundException
---- Debugging information ----
message : com/jayway/jsonpath/PathNotFoundException
cause-exception : java.lang.NoClassDefFoundError
cause-message : com/jayway/jsonpath/PathNotFoundException
first-jmeter-class : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:102)
class : org.apache.jmeter.save.ScriptWrapper
required-type : com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree[3]/hashTree/hashTree[3]/com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
line number : 118
version : 2.13 r1665067
-------------------------------
at org.apache.jmeter.save.ScriptWrapperConverter.createConversionException(ScriptWrapperConverter.java:105)
at org.apache.jmeter.save.ScriptWrapperConverter.unmarshal(ScriptWrapperConverter.java:97)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1206)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1190)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1061)
at org.apache.jmeter.save.SaveService.readTree(SaveService.java:559)
... 9 more
Caused by: java.lang.NoClassDefFoundError: com/jayway/jsonpath/PathNotFoundException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:102)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at org.apache.jmeter.save.ScriptWrapperConverter.unmarshal(ScriptWrapperConverter.java:95)
... 19 more
Caused by: java.lang.ClassNotFoundException: com.jayway.jsonpath.PathNotFoundException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 59 more
VSTS 负载测试似乎找不到 JSONPathExtractor 插件。如何将其包含在我的 .jmx 文件或支持文件上传中?非常感谢!
【问题讨论】:
-
我发现在 JMeter 2.13 版本中使用 JSON 路径提取器时出现问题(与上述相同的错误),但在 JMeter 3.0 上工作正常,我建议您尝试使用 3.0 版本
-
嗨,纳文!我目前正在使用 JMeter 3.0 (r1743807),我认为这不是问题。
标签: visual-studio jmeter azure-devops load-testing