1.报错如下:2020-03-06 16:36:07,959 ERROR o.a.j.JMeter: Uncaught exception: java.lang.NoClassDefFoundError: com/sun/jna/platform/win32/Kernel32 at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_181] at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.8.0_181] at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.8.0_181] at java.net.URLClassLoader.defineClass(Unknown Source) ~[?:1.8.0_181] at java.net.URLClassLoader.access$100(Unknown Source) ~[?:1.8.0_181] at java.net.URLClassLoaderSeleniumWatchDog.accessThreadListenerTraverser.addNode(JMeterThread.java:682) ~[ApacheJMeter_core.jar:4.0 r1823414] at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) ~[jorphan.jar:4.0 r1823414] at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:995) ~[jorphan.jar:4.0 r1823414] at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) ~[jorphan.jar:4.0 r1823414] at org.apache.jmeter.threads.JMeterThread.threadFinished(JMeterThread.java:649) ~[ApacheJMeter_core.jar:4.0 r1823414] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:305) ~[ApacheJMeter_core.jar:4.0 r1823414] at java.lang.Thread.run(Unknown Source) [?:1.8.0_181] Caused by: java.lang.ClassNotFoundException: com.sun.jna.platform.win32.Kernel32 at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_181] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_181] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_181] ... 33 more插入代码片
解决办法:发现是少了jna-3.3.0.jar和jna-3.3.0-platform.jar包,下载这两个的jar包分别为:
http://www.java2s.com/Code/Jar/j/Downloadjna330jar.htm
http://www.java2s.com/Code/Jar/j/Downloadjna330platformjar.htm
http://www.java2s.com/Code/JarDownload/jna/ (这个链接是输入搜索下载用的)
下载之后解压,将这两个包复制到JMeter安装路径的\lib目录下,重启jmeter即可。