java - 无法初始化类 org.apache.jmeter.protocol.http.parser.CssParser - JMeter
问题描述
我正在尝试在 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) [?:?]
可能是什么原因?谢谢!
解决方案
很可能您的 JMeter 安装以某种方式损坏,尝试使用JMeter 插件管理器jmeter - HTTP Protocol Support
卸载组件,然后重新安装
它应该可以解决您的安装问题。
另请注意,根据 JMeter 最佳实践,您应该始终使用最新版本的 JMeter,因此鉴于您当前的 JMeter 安装已损坏,可能是升级到JMeter 5.3的好时机(或JMeter 下载页面上提供的最新稳定版本))
推荐阅读
- for-loop - 如何迭代 For 循环直到满足特定条件?
- python - 如何避免将数据从 Python pandas 数据框复制到 SQL 数据库 SQLLite 时出现重复?
- alfresco - CMIS 1.1 中未设置的方面的属性
- three.js - 在 Three.js 场景中嵌入 Youtube(CSS3DRenderer、WebGLRenderer)
- selenium-webdriver - 如何使用硒检查svg元素是否存在
- python - 在numpy中将矩阵列乘以矩阵
- mongodb - MongoDB选择和更新条件复杂
- neo4j - Neo4j 在 ORDER BY 上表现不佳
- python - 如何从字符串中删除多次出现的字符?
- python - 将 pycountry 细分翻译成英文