MapperBuilder 的 NoClassDefFoundError
NoClassDefFoundError for MapperBuilder
我正在为 JMeter 开发插件,作为该过程的一部分,我们添加了一些第三方库。
当我 运行 应用程序时,出现错误:
java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/cfg/MapperBuilder
at io.lindstrom.mpd.MPDParser.defaultObjectMapper(MPDParser.java:57) ~[mpd-parser-0.6.jar:?]
at io.lindstrom.mpd.MPDParser.<init>(MPDParser.java:33) ~[mpd-parser-0.6.jar:?]
at com.blazemeter.jmeter.hls.logic.HlsSampler.sample(HlsSampler.java:237) ~[jmeter-bzm-hls-2.0-SNAPSHOT.jar:?]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1220) ~[ApacheJMeter_http.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.cfg.MapperBuilder
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_211]
... 9 more
我一直在添加库,因为 ClassNotFoundException "requesting" 但是,这个,我找不到修复。
依赖的 jar 不存在,这导致 class 未找到异常。将 jackson-databind https://github.com/FasterXML/jackson-databind
jar 添加到 jmeter 外部库 JMETER_HOME/lib/ext/
文件夹。
缺少 类 来自 jackson-databind jar
您应该将插件的依赖 jar 放在 lib folder 中(尽管插件 jar 本身在 lib/ext 文件夹中)
JMeter automatically finds classes from jars in the following directories:
JMETER_HOME/lib
used for utility jars
JMETER_HOME/lib/ext
used for JMeter components and plugins
If you have developed new JMeter components, then you should jar them and copy the jar into JMeter's lib/ext directory. JMeter will automatically find JMeter components in any jars found here. Do not use lib/ext for utility jars or dependency jars used by the plugins
我正在为 JMeter 开发插件,作为该过程的一部分,我们添加了一些第三方库。
当我 运行 应用程序时,出现错误:
java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/cfg/MapperBuilder
at io.lindstrom.mpd.MPDParser.defaultObjectMapper(MPDParser.java:57) ~[mpd-parser-0.6.jar:?]
at io.lindstrom.mpd.MPDParser.<init>(MPDParser.java:33) ~[mpd-parser-0.6.jar:?]
at com.blazemeter.jmeter.hls.logic.HlsSampler.sample(HlsSampler.java:237) ~[jmeter-bzm-hls-2.0-SNAPSHOT.jar:?]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1220) ~[ApacheJMeter_http.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.cfg.MapperBuilder
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_211]
... 9 more
我一直在添加库,因为 ClassNotFoundException "requesting" 但是,这个,我找不到修复。
依赖的 jar 不存在,这导致 class 未找到异常。将 jackson-databind https://github.com/FasterXML/jackson-databind
jar 添加到 jmeter 外部库 JMETER_HOME/lib/ext/
文件夹。
缺少 类 来自 jackson-databind jar
您应该将插件的依赖 jar 放在 lib folder 中(尽管插件 jar 本身在 lib/ext 文件夹中)
JMeter automatically finds classes from jars in the following directories:
JMETER_HOME/lib used for utility jars JMETER_HOME/lib/ext used for JMeter components and plugins
If you have developed new JMeter components, then you should jar them and copy the jar into JMeter's lib/ext directory. JMeter will automatically find JMeter components in any jars found here. Do not use lib/ext for utility jars or dependency jars used by the plugins