JMeter 负载测试:ClassNotFoundException:com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup

JMeter load-testing : ClassNotFoundException: com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup

我正在尝试非 GUI 和分布式 JMeter 负载测试。

在分发之前,我在本地进行了测试。我在我的笔记本电脑上安装了 JMeter,并设置了一个针对被测系统的测试计划。我安装了插件管理器并安装了并发线程插件。 我发现我的 JMX 文件是正确的并且可以工作,所以我决定推出分布式设置。

我设置了三台机器来生成负载:load-1、load-2 和 load-3。我按如下方式安装了 JMeter: apt update ; apt upgrade 所有这些 apt install jmeter 所有这些 将位于我笔记本电脑 /usr/share/jmeter/lib/ext 中的 JAR 复制到同一目录中的所有 JAR:

jmeter-plugins-casutg-2.1.jar
jmeter-plugins-cmn-jmeter-0.3.jar
jmeter-plugins-manager-0.11.jar

我在其中两个上启动了 JMeter 服务器,如下所示:

export JMETER_HOME=/usr ; $JMETER_HOME/bin/jmeter-server -Djava.rmi.server.hostname=207.112.137.21
export JMETER_HOME=/usr ; $JMETER_HOME/bin/jmeter-server -Djava.rmi.server.hostname=207.112.137.22

我使用第三个开始分布式测试如下:

jmeter -n -t ~/JMeter_API_TestPlan.jmx -R207.112.137.21,207.112.137.22

分布式设置似乎正确启动,但线程启动失败可能是因为未找到 class :

java.lang.ClassNotFoundException:com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup(无安全管理器:RMI class 加载程序已禁用)

我缺少 JAR 或配置参数?

jmeter.log 显示如下:

2017/06/23 09:34:33 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Loading user properties from: /usr/share/jmeter/bin/user.properties 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Loading system properties from: /usr/share/jmeter/bin/system.properties 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Copyright (c) 1998-2014 The Apache Software Foundation 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Version 2.11.20151206 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: java.version=1.8.0_131 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: os.name=Linux 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: os.arch=amd64 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: os.version=4.4.0-64-generic 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: file.encoding=ANSI_X3.4-1968 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Default Locale=English (United States) 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: JMeter  Locale=English (United States) 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: JMeterHome=/usr/share/jmeter 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: user.dir  =/usr/share/jmeter/lib/ext 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: PWD       =/usr/share/jmeter/lib/ext 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: IP: 127.0.1.1 Name: load-srv-1 FullName: load-srv-1.localdomain 
2017/06/23 09:34:33 INFO  - jmeter.services.FileServer: Default base='/usr/share/jmeter/lib/ext' 
2017/06/23 09:34:33 INFO  - jmeter.services.FileServer: Set new base='/home/ubuntu' 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Loading file: /home/ubuntu/JMeter_API_TestPlan.jmx 
2017/06/23 09:34:33 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 
2017/06/23 09:34:33 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
2017/06/23 09:34:33 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.6 
2017/06/23 09:34:33 INFO  - jmeter.save.SaveService: Using SaveService properties file version 1554411 
2017/06/23 09:34:33 INFO  - jmeter.save.SaveService: All converter versions present and correct 
2017/06/23 09:34:33 INFO  - jmeter.protocol.http.control.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_ 
2017/06/23 09:34:33 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default 
2017/06/23 09:34:33 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is  
2017/06/23 09:34:33 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is  
2017/06/23 09:34:33 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is  
2017/06/23 09:34:33 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is  
2017/06/23 09:34:33 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser 
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Creating summariser <summary> 
Creating summariser <summary>
Created the tree successfully using /home/ubuntu/JMeter_API_TestPlan.jmx
Configuring remote engine for 207.112.137.21
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Configuring remote engine for 207.112.137.21
Using remote object: UnicastRef [liveRef: [endpoint:[207.112.137.21:33454](remote),objID:[-48d954a6:15cd4392e27:-7fff, 7098811430065264906]]]
Configuring remote engine for 207.112.137.22
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Configuring remote engine for 207.112.137.22
Using remote object: UnicastRef [liveRef: [endpoint:[207.112.137.22:39449](remote),objID:[-238f015b:15cd4393abf:-7fff, 6897427020325789391]]]
Starting remote engines
2017/06/23 09:34:33 INFO  - jmeter.JMeter: Starting remote engines 
Starting the test @ Fri Jun 23 09:34:33 UTC 2017 (1498210473781)
2017/06/23 09:34:33 INFO  - jmeter.engine.ClientJMeterEngine: running clientengine run method 
2017/06/23 09:34:33 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.' 
2017/06/23 09:34:33 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must not contain the string: '.gui.' 
2017/06/23 09:34:33 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: [] 
2017/06/23 09:34:33 INFO  - jmeter.samplers.BatchSampleSender: Using batching (client settings) for this run. Thresholds: num=100, time=60000 
2017/06/23 09:34:33 INFO  - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run 
2017/06/23 09:34:34 INFO  - jmeter.samplers.BatchSampleSender: Using batching (client settings) for this run. Thresholds: num=100, time=60000 
2017/06/23 09:34:34 INFO  - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run 
2017/06/23 09:34:34 INFO  - jmeter.samplers.BatchSampleSender: Using batching (client settings) for this run. Thresholds: num=100, time=60000 
2017/06/23 09:34:34 INFO  - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run 
2017/06/23 09:34:34 INFO  - jmeter.samplers.BatchSampleSender: Using batching (client settings) for this run. Thresholds: num=100, time=60000 
2017/06/23 09:34:34 INFO  - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run 
2017/06/23 09:34:34 ERROR - jmeter.engine.ClientJMeterEngine: Error in rconfigure() method java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup (no security manager: RMI class loader disabled) 
2017/06/23 09:34:34 INFO  - jmeter.engine.ClientJMeterEngine: Interrupting RMI Reaper 
Error in NonGUIDriver org.apache.jmeter.engine.JMeterEngineException: Error in rconfigure() method java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup (no security manager: RMI class loader disabled)
2017/06/23 09:34:34 ERROR - jmeter.JMeter: Error in NonGUIDriver org.apache.jmeter.engine.JMeterEngineException: Error in rconfigure() method java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup (no security manager: RMI class loader disabled)
    at org.apache.jmeter.engine.ClientJMeterEngine.runTest(ClientJMeterEngine.java:156)
    at org.apache.jmeter.JMeter.runNonGui(JMeter.java:831)
    at org.apache.jmeter.JMeter.startNonGui(JMeter.java:733)
    at org.apache.jmeter.JMeter.start(JMeter.java:392)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.jmeter.NewDriver.main(NewDriver.java:259)
Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup (no security manager: RMI class loader disabled)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:377)
    at sun.rmi.transport.Transport.run(Transport.java:200)
    at sun.rmi.transport.Transport.run(Transport.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run[=14=](TCPTransport.java:683)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
    at org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub.rconfigure(Unknown Source)
    at org.apache.jmeter.engine.ClientJMeterEngine.runTest(ClientJMeterEngine.java:133)
    ... 8 more
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup (no security manager: RMI class loader disabled)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:337)

我是 运行 Ubuntu 16.04.2 LTS

  1. jmeter-plugins-cmn-jmeter-0.3.jar 应该转到 "lib" 文件夹,而不是 "lib/ext"
  2. 您正在使用 3 年以上的 JMeter 2.11,我建议升级到 JMeter 3.2 (or later) by manually downloading it from JMeter downloads page。 Ubuntu 存储库似乎包含非常过时的 JMeter 版本
  3. 为避免插件手动安装出现任何问题,我建议使用 JMeter Plugins Manager
  4. 在主控主机和所有从属主机上安装相同的插件集