非UIDriver conversionexception com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.jsonpathassertion中出错

非UIDriver conversionexception com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.jsonpathassertion中出错,jmeter,jmeter-maven-plugin,Jmeter,Jmeter Maven Plugin,背景信息 -我有一个jmeter测试计划,它验证json API调用。我想使用ATLANTBH jsonpathassertion组件,它似乎比正则表达式提取器和断言简单得多。我添加了一个断言步骤,使用jp@gc-JSON路径断言,带有示例JSON路径:$.results[0]。fulfillments[0]。fulfillmentType针对预期值 问题 在jmeter(2.1.3)gui中运行测试成功,但在命令行或在jenkins环境中运行时失败。我在pom中添加了jmeter插件 谢谢你的

背景信息 -我有一个jmeter测试计划,它验证json API调用。我想使用ATLANTBH jsonpathassertion组件,它似乎比正则表达式提取器和断言简单得多。我添加了一个断言步骤,使用jp@gc-JSON路径断言,带有示例JSON路径:$.results[0]。fulfillments[0]。fulfillmentType针对预期值

问题 在jmeter(2.1.3)gui中运行测试成功,但在命令行或在jenkins环境中运行时失败。我在pom中添加了jmeter插件

谢谢你的帮助


com.lazerycode.jmeter
jmetermaven插件
1.10.1
假的
${server}
jmeter测试
验证
性能测试
kg.apc
jmeter插件
1.0.0
Jmeter日志如下所示

    2015/09/02 11:21:29 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'C:\PP\functional-test\src\test\jmeter\BAT_Scenarios.jmx', conversion error com.thoughtworks.xstream.converters.ConversionException: com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
---- Debugging information ----
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
------------------------------- : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
---- Debugging information ----
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
-------------------------------
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
---- Debugging information ----
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
-------------------------------
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
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(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.jmeter.NewDriver.main(NewDriver.java:264)
Caused by: com.thoughtworks.xstream.converters.ConversionException: com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
---- Debugging information ----
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
------------------------------- : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
---- Debugging information ----
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
-------------------------------
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
---- Debugging information ----
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
-------------------------------
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
version             : 2.13 r1665067
-------------------------------
    at org.apache.jmeter.save.ScriptWrapperConverter.createConversionException(ScriptWrapperConverter.java:105)
    at org.apache.jmeter.save.ScriptWrapperConverter.unmarshal(ScriptWrapperConverter.java:99)
    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: com.thoughtworks.xstream.converters.ConversionException: com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
---- Debugging information ----
message             : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
line number         : 279
-------------------------------
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
    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: com.thoughtworks.xstream.mapper.CannotResolveClassException: com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion
    at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at org.apache.jmeter.save.SaveService$XStreamWrapper$1.realClass(SaveService.java:94)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
    at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
    at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:70)
    at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    ... 47 more

看起来您的POM配置不正确。我希望它看起来像这样:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>tst</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<build>
    <plugins>
        <plugin>
            <groupId>com.lazerycode.jmeter</groupId>
            <artifactId>jmeter-maven-plugin</artifactId>
            <version>1.10.1</version>
            <configuration>
                <testResultsTimestamp>false</testResultsTimestamp>
                <jmeterPlugins>
                    <plugin>
                        <groupId>kg.apc</groupId>
                        <artifactId>jmeter-plugins</artifactId>
                    </plugin>
                </jmeterPlugins>
            </configuration>
            <executions>
                <execution>
                    <id>jmeter-tests</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>jmeter</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>kg.apc</groupId>
                    <artifactId>jmeter-plugins</artifactId>
                    <version>1.0.0</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
</project>

4.0.0
com.example

或者,如果您更新到jmeter插件的1.3.0版,则会出现不同的可传递依赖性问题:


加快Jmeter的下一个版本://

请阅读并在发布银行回复之前,是的,现在我正在处理确切的传递依赖性问题,如131