【问题标题】:Could not initialize class org.apache.jmeter.protocol.http.parser.CssParser - JMeter无法初始化类 org.apache.jmeter.protocol.http.parser.CssParser - JMeter
【发布时间】:2020-06-04 13:54:55
【问题描述】:

我正在尝试在 Apache JMeter 5.2 上运行 LoadTest,当我尝试运行测试时,它显示此错误 =>

java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.protocol.http.parser.CssParser
    at java.lang.Class.forName0(Native Method) ~[?:?]
    at java.lang.Class.forName(Class.java:315) ~[?:?]
    at org.apache.jmeter.protocol.http.parser.BaseParser.getParser(BaseParser.java:66) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getParser(HTTPSamplerBase.java:1481) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.downloadPageResources(HTTPSamplerBase.java:1332) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1749) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:556) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:648) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:67) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.downloadPageResources(HTTPSamplerBase.java:1417) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1749) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:556) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:648) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:67) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1282) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1271) ~[ApacheJMeter_http.jar:5.2]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627) ~[ApacheJMeter_core.jar:5.2]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551) ~[ApacheJMeter_core.jar:5.2]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490) ~[ApacheJMeter_core.jar:5.2]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) ~[ApacheJMeter_core.jar:5.2]
    at java.lang.Thread.run(Thread.java:834) [?:?]

可能是什么原因? 谢谢!

【问题讨论】:

    标签: java jmeter load-testing


    【解决方案1】:

    很可能您的 JMeter 安装以某种方式损坏,尝试使用 JMeter Plugins Manager 卸载 jmeter - HTTP Protocol Support 组件,然后重新安装它

    它应该可以解决您的安装问题。


    还要注意according to JMeter Best Practices you should always be using the latest version of JMeter,因此鉴于您当前的 JMeter 安装已损坏,可能是升级到 JMeter 5.3 的好时机(或在 JMeter Downloads 页面上提供的最新稳定版本)

    【讨论】:

    • 我已经将 Jmeter 更新到了最新版本,并且我已经完成了你所说的关于插件的事情,并且出现了同样的错误:(
    【解决方案2】:

    我已经通过在每次测试中重新配置 HTTP 请求来修复它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-03
      • 2012-08-01
      • 2012-10-10
      • 2015-11-23
      • 2011-09-28
      • 2014-10-22
      • 2021-02-14
      • 2017-09-30
      相关资源
      最近更新 更多