Jmeter警告每次出现时都会出现

时间:2017-04-27 22:47:44

标签: jmeter warnings

我正在使用Jmeter GUI并在打开时显示警告,这是错误日志显示的内容:2

017-04-28 03:44:07,288 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.assertions.BSFAssertion
2017-04-28 03:44:10,020 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.extractor.BSFPostProcessor
2017-04-28 03:44:10,123 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.modifiers.BSFPreProcessor
2017-04-28 03:44:10,221 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2017-04-28 03:44:10,221 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2017-04-28 03:44:10,221 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2017-04-28 03:44:10,221 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2017-04-28 03:44:10,222 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2017-04-28 03:44:10,222 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser
2017-04-28 03:44:11,571 ERROR o.a.j.e.KeyToolUtils: Exception checking for keytool existence, will return false
java.io.IOException: Cannot run program "keytool": CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source) ~[?:1.8.0_73]
    at org.apache.jorphan.exec.SystemCommand.run(SystemCommand.java:142) ~[jorphan.jar:3.2 r1790748]
    at org.apache.jorphan.exec.SystemCommand.run(SystemCommand.java:125) ~[jorphan.jar:3.2 r1790748]
    at org.apache.jorphan.exec.KeyToolUtils.checkKeytool(KeyToolUtils.java:436) ~[jorphan.jar:3.2 r1790748]
    at org.apache.jorphan.exec.KeyToolUtils.<clinit>(KeyToolUtils.java:94) ~[jorphan.jar:3.2 r1790748]
    at org.apache.jmeter.protocol.http.proxy.ProxyControl.<clinit>(ProxyControl.java:248) ~[ApacheJMeter_http.jar:3.2 r1790748]
    at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.createPortPanel(ProxyControlGui.java:708) ~[ApacheJMeter_http.jar:3.2 r1790748]
    at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.init(ProxyControlGui.java:664) ~[ApacheJMeter_http.jar:3.2 r1790748]
    at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.<init>(ProxyControlGui.java:239) ~[ApacheJMeter_http.jar:3.2 r1790748]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_73]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_73]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_73]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_73]
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_73]
    at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:505) ~[ApacheJMeter_core.jar:3.2 r1790748]
    at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:169) ~[ApacheJMeter_core.jar:3.2 r1790748]
    at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93) ~[ApacheJMeter_core.jar:3.2 r1790748]
    at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156) ~[ApacheJMeter_core.jar:3.2 r1790748]
    at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:46) ~[ApacheJMeter_core.jar:3.2 r1790748]
    at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:74) ~[ApacheJMeter_core.jar:3.2 r1790748]
    at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:59) ~[ApacheJMeter_core.jar:3.2 r1790748]
    at java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_73]
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_73]
    at java.awt.EventQueue.access$500(Unknown Source) [?:1.8.0_73]
    at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_73]
    at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_73]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_73]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_73]
    at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_73]
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_73]
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_73]
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_73]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_73]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_73]
    at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_73]
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method) ~[?:1.8.0_73]
    at java.lang.ProcessImpl.<init>(Unknown Source) ~[?:1.8.0_73]
    at java.lang.ProcessImpl.start(Unknown Source) ~[?:1.8.0_73]
    ... 35 more
2017-04-28 03:44:14,937 INFO o.a.j.e.KeyToolUtils: keytool found at 'C:\Program Files\Java\jre1.8.0_73\bin\keytool'
2017-04-28 03:44:14,938 INFO o.a.j.p.h.p.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file D:\Jmeter\apache-jmeter-3.2\bin\proxyserver.jks
2017-04-28 03:44:15,997 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.java.sampler.BSFSampler
2017-04-28 03:44:16,117 INFO o.a.j.s.FileServer: Default base='D:\Jmeter\apache-jmeter-3.2\bin'
2017-04-28 03:44:16,852 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.config.MongoSourceElement
2017-04-28 03:44:16,854 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler
2017-04-28 03:44:20,136 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.timers.BSFTimer
2017-04-28 03:44:20,265 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.visualizers.BSFListener
2017-04-28 03:44:20,922 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
2017-04-28 03:44:20,923 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2017-04-28 03:44:20,923 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true
2017-04-28 03:44:20,924 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000

注意:我尝试使用管理员运行它但它没有用。同时使用常量计时器状态始终显示每个样本的警告标志。非常感谢提前获得指导。

2 个答案:

答案 0 :(得分:4)

您收到的错误表明JMeter找不到keytool实用程序,它是Java运行时环境或开发工具包的一部分。

但是,如果您在错误后查看下一行:

  

2017-04-28 03:44:14,937 INFO oajeKeyToolUtils: keytool &#39; C:\ Program Files \ Java \ jre1.8.0_73 \ bin \ keytool&#39;

因此您可以忽略此警告(或通过JMeter bugzilla报告),以便开发人员可以查看它。

与此同时,我建议采用以下解决方法:

  1. 卸载jre1.8.0_73(在任何情况下都是旧的)
  2. Oracle website
  3. 下载最新版本的64位服务器JRE或JDK
  4. 将其安装到不包含空格或非ASCII字符的文件夹,即C:\java
  5. 将下两行添加到jmeter.bat启动脚本的开头:

    set JAVA_HOME=c:\java
    set PATH=%JAVA_HOME%\bin;%PATH%
    
  6. 它应该给JMeter一个好的&#34; Java配置和问题应该消失。

    有关安装和开始使用JMeter

    的正确步骤,请参阅How to Get Started With JMeter: Part 1 - Installation & Test Plans文章

答案 1 :(得分:1)

在Windows上,您可能会遇到无法扩展环境变量 PATH ,例如:

C:\>echo %PATH%
C:\ProgramData\Oracle\Java\javapath;%JAVA_HOME%\bin;C:\Windows\System32;

注意字面值%JAVA_HOME%\ bin 。这是由:

引起的
  1. &#39; PATH&#39;包含其他变量的引用
  2. &#39; PATH&#39;在没有评估的情况下修改(例如通过程序)
  3. <强>解决方案

    1. 打开环境设置框
    2. 对PATH的值进行一些修改(触发扩展变量)
    3. 这应该可以解决问题。我们现在可以打开 cmd窗口并检查PATH的值。

      C:\>echo %PATH%
      C:\ProgramData\Oracle\Java\javapath;C:\java\jdk1.8.0_121\bin;C:\Windows\System32;
      

      请注意,值%JAVA_HOME%\ bin 已扩展为 C:\ java \ jdk1.8.0_121 \ bin