问题
I have downloaded amf plugins as given in How to enable amf sampler type and started recording using AMF proxy server in Jmeter 4.0 but I am getting below error message in log and web page is not loading
java.lang.NoClassDefFoundError:
org/apache/jmeter/protocol/http/sampler/HTTPSampler2
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_141]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_141]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_141]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[?:1.8.0_141]
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[?:1.8.0_141]
at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[?:1.8.0_141]
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[?:1.8.0_141]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_141]
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[?:1.8.0_141]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_141]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_141]
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.8.0_141]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[?:1.8.0_141]
at java.lang.Class.getConstructor0(Class.java:3075) ~[?:1.8.0_141]
at java.lang.Class.newInstance(Class.java:412) ~[?:1.8.0_141]
at org.apache.jmeter.protocol.amf.proxy.AmfDaemon.run(AmfDaemon.java:125) ~[JMeter-AMF.jar:?]
Caused by: java.lang.ClassNotFoundException: org.apache.jmeter.protocol.http.sampler.HTTPSampler2
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_141]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_141]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_141]
... 16 more
回答1:
Looking into commit 2651c6ffc534e0137849377fce4b1b0e1aafca47 the file src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
has been removed as a part of issue 60727 during JMeter 3.2 release
So the maximum version you can use AMF Proxy Server with is JMeter 3.1.
You can still download JMeter 3.1 from JMeter Archives page
回答2:
As per Dmitri Answer the plugin you're trying to use only works with JMeter <= 3.1 due to drop of HTTPSampler2 within removal of commons-httpclient-3.x in JMeter. JMeter 3.1 which is now very old (3 versions away) and suffers from 2 CVEs in distributed testing.
Also see this:
- Issues in running Jmeter amfproxy
Your alternative is to use this commercial plugin for JMeter which works with latest version including 4.0, it works with BlazeDS only , not GraniteDS.
Disclaimer: we are providers of this plugin.
来源:https://stackoverflow.com/questions/49672185/unable-to-record-in-jmeter-using-amf-proxy-server