2017-08-17 50 views
0

我得到和通過mvn運行jmeter測試腳本時出錯。NonGUIDriver java.lang.NullPointerException中的錯誤Maven Eclipse

這裏是我的pom.xml

<build> 
    <plugins> 
     <plugin> 
      <groupId>com.lazerycode.jmeter</groupId> 
      <artifactId>jmeter-maven-plugin</artifactId> 
      <version>2.2.0</version> 
      <executions> 
       <execution> 
        <id>jmeter-tests</id> 
        <phase>verify</phase> 
        <goals> 
         <goal>jmeter</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <jmeterExtensions> 
        <artifact>kg.apc:jmeter-plugins:pom:1.3.1</artifact> 
       </jmeterExtensions> 
       <jmeterExtensions> 
        <artifact>kg.apc:jmeter-plugins-manager:jar:0.10</artifact> 
       </jmeterExtensions> 
       <jmeterExtensions> 
        <artifact>kg.apc:jmeter-plugins-json:jar:2.3</artifact> 
       </jmeterExtensions> 
       <junitLibraries> 
        <artifact>com.lazerycode.junit:junit-test:1.0.0</artifact> 
       </junitLibraries> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 
<dependencies> 
</dependencies> 

的JMeter日誌文件:

2017年8月17日16點57分42秒錯誤 - jmeter.save.SaveService:轉換錯誤com.thoughtworks .xstream.converters.ConversionException:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com .atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor ----調試信息---- 消息:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor cause-exception:com.thoughtworks。 xstream.mapper.CannotResolveClassException 原因的消息:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor 類:org.apache.jorphan.collections.ListedHashTree required-type:org.apache.jorphan.collections.ListedHashTree path:/jmeterTestPlan/hashTree/hashTree/hashTree[2]/hashTree/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor line number:76

我嘗試了一切,但仍然沒有成功。

這裏是我得到

錯誤的控制檯輸出

[錯誤]未能執行目標com.lazerycode.jmeter:在項目的JMeter-演示配置(配置):JMeter的,Maven的插件:2.2.0 :找不到神器公地MATH3:公地MATH3:罐子:3.4.1在中央(https://repo.maven.apache.org/maven2) - > [求助1]

回答

1

你需要下面的行添加到您的pom.xml文件的jmeterExtensions部分:

<artifact>kg.apc:jmeter-plugins-json:pom:2.6</artifact> 

你得到的錯誤是關於缺少JSON Path Extractor其住在jmeter-plugins-json Maven構件

的更多信息:

+0

您好我補充說,但現在我得到不同的錯誤:無法找到神器commons- math3:commons-math3:jar:3.4.1在中央 –