" java.lang.IllegalArgumentException:结果日志文件不为空"在jmeter3.0中为非GUI模式生成仪表板报告时显示错误

时间:2016-09-17 06:55:11

标签: java jmeter

在测试运行之后,我在linux环境中使用非GUI模式为jmeter3.0生成了一个仪表板报告。我已在终端中使用以下格式生成报告。

[vairamuthu_m@igstdev053 /]$ jmeter3 -n -t /home/local/IGSTDEV/vairamuthu_m/Desktop/kycstd.jmx -l 
/home/local/IGSTDEV/vairamuthu_m/Desktop/std.jtl -e -o
/home/local/IGSTDEV/vairamuthu_m/Desktop/Jmeter3.0_testplan/result/sturesult.csv

显示以下错误:

Writing log file to: /jmeter.log
log_file=jmeter.log java.io.FileNotFoundException: jmeter.log (Permission denied)              
[log_file-> System.out]
2016/09/17 11:42:29 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US               
2016/09/17 11:42:29 INFO  - jmeter.JMeter: Loading user properties from: /opt/SDK/apache-jmeter-3.0/bin/user.properties  
2016/09/17 11:42:29 INFO  - jmeter.JMeter: Loading system properties from: /opt/SDK/apache-jmeter-3.0/bin/system.properties   
2016/09/17 11:42:29 INFO  - jmeter.JMeter: Copyright (c) 1998-2016 The Apache Software Foundation                                                           
2016/09/17 11:42:29 INFO  - jmeter.JMeter: Version 3.0 r1743807  
2016/09/17 11:42:29 INFO  - jmeter.JMeter: java.version=1.7.0_25      
2016/09/17 11:42:29 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Server VM                
2016/09/17 11:42:29 INFO  - jmeter.JMeter: os.name=Linux                       
2016/09/17 11:42:29 INFO  - jmeter.JMeter: os.arch=i386            
2016/09/17 11:42:29 INFO  - jmeter.JMeter: os.version=3.11.10-301.fc20.i686         
2016/09/17 11:42:29 INFO  - jmeter.JMeter: file.encoding=UTF-8               
2016/09/17 11:42:29 INFO  - jmeter.JMeter: Max memory     =805306368 
2016/09/17 11:42:29 INFO  - jmeter.JMeter: Available Processors =2 
2016/09/17 11:42:29 INFO  - jmeter.JMeter: Default Locale=English (United States) 
2016/09/17 11:42:29 INFO  - jmeter.JMeter: JMeter  Locale=English (United States) 
2016/09/17 11:42:29 INFO  - jmeter.JMeter: JMeterHome=/opt/SDK/apache-jmeter- 3.0 
2016/09/17 11:42:29 INFO  - jmeter.JMeter: user.dir  =/  
2016/09/17 11:42:29 INFO  - jmeter.JMeter: PWD       =/ 
2016/09/17 11:42:29 INFO  - jmeter.JMeter: IP: 127.0.0.1 Name: igstdev053 FullName: igstdev053.igstdev.com  
2016/09/17 11:42:29 INFO  - jmeter.JMeter: Setting property 'jmeter.reportgenerator.outputdir' to:'/home/local/IGSTDEV/vairamuthu_m/Desktop/Jmeter3.0_testplan/result/sturesult.txt'                                      
2016/09/17 11:42:29 INFO  - jmeter.services.FileServer: Default base='/' 
2016/09/17 11:42:29 INFO  - jmeter.services.FileServer: Set new base='/home/local/IGSTDEV/vairamuthu_m/Desktop'                             
2016/09/17 11:42:29 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2                                      
2016/09/17 11:42:29 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
2016/09/17 11:42:29 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.9 
2016/09/17 11:42:29 INFO  - jmeter.save.SaveService: All converter versions present and correct 
2016/09/17 11:42:29 INFO  - jmeter.save.SaveService: Loading file: /home/local/IGSTDEV/vairamuthu_m/Desktop/kycstd.jmx 
2016/09/17 11:42:29 INFO  - jmeter.protocol.http.control.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_ 
2016/09/17 11:42:29 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/09/17 11:42:29 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/09/17 11:42:29 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/09/17 11:42:29 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/09/17 11:42:29 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser 
2016/09/17 11:42:29 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser 
2016/09/17 11:42:30 INFO  - jmeter.JMeter: Creating summariser <summary> 
Creating summariser <summary>
2016/09/17 11:42:30 INFO  - jmeter.report.dashboard.ReportGenerator: ReportGenerator will use for Parsing the separator:',' 
Error in NonGUIDriver java.lang.IllegalArgumentException: Results file:/home/local/IGSTDEV/vairamuthu_m/Desktop/std.jtl is not empty
2016/09/17 11:42:30 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.IllegalArgumentException: Results file:/home/local/IGSTDEV/vairamuthu_m/Desktop/std.jtl is not empty
    at org.apache.jmeter.report.dashboard.ReportGenerator.<init>(ReportGenerator.java:134)
    at org.apache.jmeter.JMeter.runNonGui(JMeter.java:922)
    at org.apache.jmeter.JMeter.startNonGui(JMeter.java:876)
    at org.apache.jmeter.JMeter.start(JMeter.java:501)
    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:259)

请给我一个解决方案......

谢谢, 瓦拉默。

3 个答案:

答案 0 :(得分:1)

根据stacktrace:

  

2016/09/17 11:42:30错误 - jmeter.JMeter:NonGUIDriver中的错误java.lang.IllegalArgumentException:结果文件:/home/local/IGSTDEV/vairamuthu_m/Desktop/std.jtl不为空       在org.apache.jmeter.report.dashboard.ReportGenerator。(ReportGenerator.java:134)

JMeter通知您该文件&#34; /home/local/IGSTDEV/vairamuthu_m/Desktop/std.jtl"不是空的,因为它不想覆盖它。

因此,如果您不需要其内容或将输出文件更改为其他名称,请将其删除。

答案 1 :(得分:1)

您也可以使用new feature覆盖jtl文件(自JMeter 3.3起)

jmeter ... -f -l std.jtl -e -o ...
  

报告生成:-f of -forceDeleteResultFile选项

答案 2 :(得分:0)

您可以使用 -f 来覆盖它:

jmeter -n -t [jmx file] -l [results file] -f -e -o [Path to web report folder]