Jmeter 无法与 Junit 一起正常工作(无法初始化 class org.apache.jmeter.gui.util.MenuFactory)
Jmeter not working correctly with Junit (Could not initialize class org.apache.jmeter.gui.util.MenuFactory)
我正在尝试使用 JMeter 进行一些成本测试,但我的计划是使用我们当前的 API 单元测试套件作为成本测试计划,因为许多测试模拟用户流。话虽如此,我 运行 遇到了 JMeter 的一些问题。我应该在 /lib/junit 文件夹中有带有单元测试的 jar,但是当我启动 JMeter 时,编辑选项卡没有任何项目(在 mac 上,根据我的研究,这个问题产生了一个灰色的编辑windows 上的按钮),我无法右键单击任何对象,并且 JUnit 采样器没有出现在测试计划中。这是日志中的数据:
2016/07/08 13:51:33 WARN - jmeter.gui.util.MenuFactory: Missing jar? Could not create kg.apc.jmeter.config.redis.RedisDataSet. java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool$Config
2016/07/08 13:51:33 INFO - jmeter.util.BSFTestElement: Registering JMeter version of JavaScript engine as work-round for BSF-22
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser
2016/07/08 13:51:33 INFO - jorphan.exec.KeyToolUtils: keytool found at 'keytool'
2016/07/08 13:51:33 INFO - jmeter.protocol.http.proxy.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file /Users/tester/apache-jmeter-3.0/bin/proxyserver.jks
2016/07/08 13:51:34 WARN - jmeter.gui.util.MenuFactory: Could not instantiate org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access0(URLClassLoader.java:73)
at java.net.URLClassLoader.run(URLClassLoader.java:368)
at java.net.URLClassLoader.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.jorphan.reflect.ClassFinder.isChildOf(ClassFinder.java:377)
at org.apache.jorphan.reflect.ClassFinder.access[=12=]0(ClassFinder.java:47)
at org.apache.jorphan.reflect.ClassFinder$ExtendsClassFilter.accept(ClassFinder.java:92)
at org.apache.jorphan.reflect.ClassFinder.findClassesInOnePath(ClassFinder.java:441)
at org.apache.jorphan.reflect.ClassFinder.findClasses(ClassFinder.java:289)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:264)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:196)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:178)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:140)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.setupClasslist(JUnitTestSamplerGui.java:181)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.createClassPanel(JUnitTestSamplerGui.java:212)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.init(JUnitTestSamplerGui.java:167)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.<init>(JUnitTestSamplerGui.java:147)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:492)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:160)
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access[=12=]0(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2016/07/08 13:51:34 ERROR - jmeter.gui.util.MenuFactory: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access0(URLClassLoader.java:73)
at java.net.URLClassLoader.run(URLClassLoader.java:368)
at java.net.URLClassLoader.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.jorphan.reflect.ClassFinder.isChildOf(ClassFinder.java:377)
at org.apache.jorphan.reflect.ClassFinder.access[=12=]0(ClassFinder.java:47)
at org.apache.jorphan.reflect.ClassFinder$ExtendsClassFilter.accept(ClassFinder.java:92)
at org.apache.jorphan.reflect.ClassFinder.findClassesInOnePath(ClassFinder.java:441)
at org.apache.jorphan.reflect.ClassFinder.findClasses(ClassFinder.java:289)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:264)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:196)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:178)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:140)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.setupClasslist(JUnitTestSamplerGui.java:181)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.createClassPanel(JUnitTestSamplerGui.java:212)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.init(JUnitTestSamplerGui.java:167)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.<init>(JUnitTestSamplerGui.java:147)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:492)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:160)
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access[=12=]0(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2016/07/08 13:51:34 ERROR - jmeter.JMeter: Uncaught exception: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access0(URLClassLoader.java:73)
at java.net.URLClassLoader.run(URLClassLoader.java:368)
at java.net.URLClassLoader.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.jorphan.reflect.ClassFinder.isChildOf(ClassFinder.java:377)
at org.apache.jorphan.reflect.ClassFinder.access[=12=]0(ClassFinder.java:47)
at org.apache.jorphan.reflect.ClassFinder$ExtendsClassFilter.accept(ClassFinder.java:92)
at org.apache.jorphan.reflect.ClassFinder.findClassesInOnePath(ClassFinder.java:441)
at org.apache.jorphan.reflect.ClassFinder.findClasses(ClassFinder.java:289)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:264)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:196)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:178)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:140)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.setupClasslist(JUnitTestSamplerGui.java:181)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.createClassPanel(JUnitTestSamplerGui.java:212)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.init(JUnitTestSamplerGui.java:167)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.<init>(JUnitTestSamplerGui.java:147)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:492)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:160)
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access[=12=]0(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2016/07/08 13:51:35 ERROR - jmeter.JMeter: Uncaught exception: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.gui.util.MenuFactory
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access[=12=]0(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
我整天都在做一些研究,到目前为止没有任何解决方案有帮助。因此,没有人会浪费时间,像 this 这样的结果,实际上所有来自此日志中各种堆栈跟踪错误的 google 搜索结果都没有产生可行的结果。我正在使用 Jmeter 3,但已尝试使用 jmeter 2.12 和 jmeter 2.9。这可能相关也可能不相关,但 Jmeter 2.12 的工作原理是不会发生此错误,但是 none 的单元测试出现在采样器中。
第一行说明一切:
Missing jar?
Could not create kg.apc.jmeter.config.redis.RedisDataSet. java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool$Config
这是由于 JMeter 类路径中缺少 Apache Pool jar。
看起来您的测试是在安装了 Redis 插件的某个地方创建的,您目前正在尝试在干净的 JMeter 上 运行 它。
我会推荐以下内容:
- 获取"clean" JMeter 3.0
- Install JMeter Plugin Manager
- 使用插件管理器安装Redis数据集
- 将您的测试库导入 "lib/junit" 文件夹
- 重启 JMeter
我建议你:
安装干净的 3.0 版本
在jmeter/lib
中添加你的依赖
你的 junit 类 在 lib/junit
如果使用 junit 4,请确保在 JUnit 请求采样器中勾选“搜索 JUnit4 注释”框
您的案例无需安装 Jmeter 插件或插件管理器。
如果问题仍然存在,请显示您的新 jmeter.log 文件
我解决了每个人,但它并没有真正解释为什么这些是堆栈跟踪中的错误。单元测试需要凭据,事实证明我必须将其放在 Jmeter /bin 文件夹中。一旦我这样做了,测试 运行 就很好了。同样,我不确定为什么这会导致它造成的错误。
我正在尝试使用 JMeter 进行一些成本测试,但我的计划是使用我们当前的 API 单元测试套件作为成本测试计划,因为许多测试模拟用户流。话虽如此,我 运行 遇到了 JMeter 的一些问题。我应该在 /lib/junit 文件夹中有带有单元测试的 jar,但是当我启动 JMeter 时,编辑选项卡没有任何项目(在 mac 上,根据我的研究,这个问题产生了一个灰色的编辑windows 上的按钮),我无法右键单击任何对象,并且 JUnit 采样器没有出现在测试计划中。这是日志中的数据:
2016/07/08 13:51:33 WARN - jmeter.gui.util.MenuFactory: Missing jar? Could not create kg.apc.jmeter.config.redis.RedisDataSet. java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool$Config
2016/07/08 13:51:33 INFO - jmeter.util.BSFTestElement: Registering JMeter version of JavaScript engine as work-round for BSF-22
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2016/07/08 13:51:33 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser
2016/07/08 13:51:33 INFO - jorphan.exec.KeyToolUtils: keytool found at 'keytool'
2016/07/08 13:51:33 INFO - jmeter.protocol.http.proxy.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file /Users/tester/apache-jmeter-3.0/bin/proxyserver.jks
2016/07/08 13:51:34 WARN - jmeter.gui.util.MenuFactory: Could not instantiate org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access0(URLClassLoader.java:73)
at java.net.URLClassLoader.run(URLClassLoader.java:368)
at java.net.URLClassLoader.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.jorphan.reflect.ClassFinder.isChildOf(ClassFinder.java:377)
at org.apache.jorphan.reflect.ClassFinder.access[=12=]0(ClassFinder.java:47)
at org.apache.jorphan.reflect.ClassFinder$ExtendsClassFilter.accept(ClassFinder.java:92)
at org.apache.jorphan.reflect.ClassFinder.findClassesInOnePath(ClassFinder.java:441)
at org.apache.jorphan.reflect.ClassFinder.findClasses(ClassFinder.java:289)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:264)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:196)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:178)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:140)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.setupClasslist(JUnitTestSamplerGui.java:181)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.createClassPanel(JUnitTestSamplerGui.java:212)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.init(JUnitTestSamplerGui.java:167)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.<init>(JUnitTestSamplerGui.java:147)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:492)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:160)
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access[=12=]0(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2016/07/08 13:51:34 ERROR - jmeter.gui.util.MenuFactory: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access0(URLClassLoader.java:73)
at java.net.URLClassLoader.run(URLClassLoader.java:368)
at java.net.URLClassLoader.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.jorphan.reflect.ClassFinder.isChildOf(ClassFinder.java:377)
at org.apache.jorphan.reflect.ClassFinder.access[=12=]0(ClassFinder.java:47)
at org.apache.jorphan.reflect.ClassFinder$ExtendsClassFilter.accept(ClassFinder.java:92)
at org.apache.jorphan.reflect.ClassFinder.findClassesInOnePath(ClassFinder.java:441)
at org.apache.jorphan.reflect.ClassFinder.findClasses(ClassFinder.java:289)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:264)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:196)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:178)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:140)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.setupClasslist(JUnitTestSamplerGui.java:181)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.createClassPanel(JUnitTestSamplerGui.java:212)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.init(JUnitTestSamplerGui.java:167)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.<init>(JUnitTestSamplerGui.java:147)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:492)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:160)
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access[=12=]0(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2016/07/08 13:51:34 ERROR - jmeter.JMeter: Uncaught exception: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access0(URLClassLoader.java:73)
at java.net.URLClassLoader.run(URLClassLoader.java:368)
at java.net.URLClassLoader.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.jorphan.reflect.ClassFinder.isChildOf(ClassFinder.java:377)
at org.apache.jorphan.reflect.ClassFinder.access[=12=]0(ClassFinder.java:47)
at org.apache.jorphan.reflect.ClassFinder$ExtendsClassFilter.accept(ClassFinder.java:92)
at org.apache.jorphan.reflect.ClassFinder.findClassesInOnePath(ClassFinder.java:441)
at org.apache.jorphan.reflect.ClassFinder.findClasses(ClassFinder.java:289)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:264)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:196)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:178)
at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:140)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.setupClasslist(JUnitTestSamplerGui.java:181)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.createClassPanel(JUnitTestSamplerGui.java:212)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.init(JUnitTestSamplerGui.java:167)
at org.apache.jmeter.protocol.java.control.gui.JUnitTestSamplerGui.<init>(JUnitTestSamplerGui.java:147)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:492)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:160)
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access[=12=]0(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2016/07/08 13:51:35 ERROR - jmeter.JMeter: Uncaught exception: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.gui.util.MenuFactory
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access[=12=]0(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
我整天都在做一些研究,到目前为止没有任何解决方案有帮助。因此,没有人会浪费时间,像 this 这样的结果,实际上所有来自此日志中各种堆栈跟踪错误的 google 搜索结果都没有产生可行的结果。我正在使用 Jmeter 3,但已尝试使用 jmeter 2.12 和 jmeter 2.9。这可能相关也可能不相关,但 Jmeter 2.12 的工作原理是不会发生此错误,但是 none 的单元测试出现在采样器中。
第一行说明一切:
Missing jar?
Could not create kg.apc.jmeter.config.redis.RedisDataSet. java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool$Config
这是由于 JMeter 类路径中缺少 Apache Pool jar。
看起来您的测试是在安装了 Redis 插件的某个地方创建的,您目前正在尝试在干净的 JMeter 上 运行 它。
我会推荐以下内容:
- 获取"clean" JMeter 3.0
- Install JMeter Plugin Manager
- 使用插件管理器安装Redis数据集
- 将您的测试库导入 "lib/junit" 文件夹
- 重启 JMeter
我建议你:
安装干净的 3.0 版本
在jmeter/lib
中添加你的依赖
你的 junit 类 在 lib/junit
如果使用 junit 4,请确保在 JUnit 请求采样器中勾选“搜索 JUnit4 注释”框
您的案例无需安装 Jmeter 插件或插件管理器。
如果问题仍然存在,请显示您的新 jmeter.log 文件
我解决了每个人,但它并没有真正解释为什么这些是堆栈跟踪中的错误。单元测试需要凭据,事实证明我必须将其放在 Jmeter /bin 文件夹中。一旦我这样做了,测试 运行 就很好了。同样,我不确定为什么这会导致它造成的错误。