![](/img/trans.png)
[英]Could not initialize class org.apache.jmeter.protocol.http.parser.CssParser - JMeter
[英]Could not initialize class org.apache.jmeter.protocol.http.proxy.ProxyControl
嗨,我正在尝试在 IntelliJ 中运行我的 java 代码,并且还尝试初始化 apache JMeter,但有人可以解释一下可能是错的吗?
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.protocol.http.proxy.ProxyControl
at jdk.internal.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:100)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readBareItem(AbstractCollectionConverter.java:132)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:117)
at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readBareItem(AbstractCollectionConverter.java:132)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:117)
at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at org.apache.jmeter.save.ScriptWrapperConverter.unmarshal(ScriptWrapperConverter.java:95)
... 22 more
java.lang.IllegalArgumentException: Problem loading XML from:'C:\Users\IEUser\Desktop\apache-jmeter-3.1\bin\transactions\PetStore\all_transactions_local_server.jmx', missing class com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : java.lang.NoClassDefFoundError
cause-message : Could not initialize class org.apache.jmeter.protocol.http.proxy.ProxyControl
first-jmeter-class : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:100)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/ProxyControl
line number : 15
version : 3.1 r1770033
根据NoClassDefFoundError描述:
如果 Java 虚拟机或 ClassLoader 实例尝试加载 class 的定义(作为正常方法调用的一部分或作为使用新表达式创建新实例的一部分)并且找不到 ZA2F2ED2AA2A4F8EBC2CBB4C21 的定义。
搜索到的 class 定义在编译当前正在执行的 class 时存在,但无法再找到该定义。
你至少需要:
在您的项目类路径中,一旦完成,您将能够运行您的代码。
您可能还会发现在不使用 JMeter GUI 和jmeter-from-code示例项目的情况下启动 JMeter 测试的五种方法有用/有趣
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.