【问题标题】:JMeter Maven Plugin - remote test machine cannot be configuredJMeter Maven Plugin - 无法配置远程测试机
【发布时间】:2015-07-29 11:28:51
【问题描述】:

当我在远程从属机器上通过 jenkins 运行 jmeter 测试时,我不断收到此错误(错误代码如下):

[INFO] -------------------------------------------------------
[INFO]  P E R F O R M A N C E    T E S T S
[INFO] -------------------------------------------------------
[INFO]  
[INFO]  
[info]  
[debug] JMeter is called with the following command line arguments: -n -t C:\Performance_Framework\Project\src\test\jmeter\Example.jmx -l C:\Performance_Framework\Project\target\jmeter\results\Example.jtl -d C:\Performance_Framework\Project\target\jmeter -L DEBUG -j C:\Performance_Framework\CMS\target\jmeter\logs\Example.jmx.log -r -R 10.0.20.100,10.0.20.101 -X -Djava.rmi.server.hostname 10.0.20.200 -Dsun.net.http.allowRestrictedHeaders true
[info] Executing test: Example.jmx

[info] Creating summariser <summary>
[info] Created the tree successfully using C:\Performance_Framework\Project\src\test\jmeter\Example.jmx
[info] Configuring remote engine: 10.0.20.100
[info] error unmarshalling return; nested exception is: 
[info]  java.lang.ClassNotFoundException: org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub (no security manager: RMI class loader disabled)
[info] Failed to configure 10.0.20.100
[info] Configuring remote engine: 10.0.20.101
[info] error unmarshalling return; nested exception is: 
[info]  java.lang.ClassNotFoundException: org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub (no security manager: RMI class loader disabled)
[info] Failed to configure 10.0.20.101
[info] Stopping remote engines
[info] Remote engines have been stopped
[info] Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:[10.0.20.100, 10.0.20.101]
[info] Completed Test: Example.jmx

现在我对机器的当前 POM 设置:

<configuration>
 --------------------------------
        <propertiesSystem>
            <java.rmi.server.hostname>10.0.20.200</java.rmi.server.hostname>
        </propertiesSystem>
        <remoteConfig>
            <startServersBeforeTests>true</startServersBeforeTests>
            <serverList>10.0.20.100,10.0.20.101</serverList>
            <stopServersAfterTests>true</stopServersAfterTests>
        </remoteConfig>                             
</configuration>

如果我从 JMETER GUI 运行测试一切正常,远程主机启动并成功执行测试。

我认为一切都设置正确,jmeter-server.bat 在每个从属设备上运行测试之前启动。

还有一些我从 jmeter maven 插件 wiki 上的这句话中不明白的地方:

runremote 命令发送到 JMeter,它将启动任何远程 您第一次在 jmeter.properties 中定义的服务器 测试开始。

项目的哪个 jmeter.properties 文件?如果是,那么我不知道如何将其定义为始终在每次测试运行时清理目标文件夹,从而导出生成的 jmeter 属性文件。

稍后编辑:我什至创建了 jmeter.properties 文件并添加到 src/test/jmeter 目录中并在那里定义了远程主机,但仍然没有。

那么你们有什么建议呢?

【问题讨论】:

    标签: jenkins jmeter jmeter-maven-plugin


    【解决方案1】:

    我通过添加 java.rmi.server.hostname 来编辑 jmeter-server 文件,以某种方式解决了连接问题。

    但我不喜欢的是测试执行时间,这太可怕了,即使有一个线程应该在 1-2 秒内完成,但它仍然显示正在尝试接收关闭消息。

    [INFO] -------------------------------------------------------
    [INFO]  P E R F O R M A N C E    T E S T S
    [INFO] -------------------------------------------------------
    [INFO]  
    
    [INFO]  
    [info]  
    [debug] JMeter is called with the following command line arguments: -n -t C:\Performance_Framework\CMS\src\test\jmeter\Example.jmx -l C:\Performance_Framework\CMS\target\jmeter\results\Example.jtl -d C:\Performance_Framework\CMS\target\jmeter -L DEBUG -q C:\Performance_Framework\CMS\src\test\jmeter\jmeter.properties -j C:\Performance_Framework\CMS\target\jmeter\logs\Example.jmx.log -r -X -Djava.rmi.server.hostname 10.0.20.200 -Dsun.net.http.allowRestrictedHeaders true
    [info] Executing test: SearchForModule.jmx
    
    [info] Creating summariser <summary>
    [info] Created the tree successfully using C:\Performance_Framework\CMS\src\test\jmeter\SearchForModule.jmx
    [info] Configuring remote engine: 10.0.20.100
    [info] Configuring remote engine: 10.0.20.101
    [info] Starting remote engines
    [info] Starting the test @ Thu Jul 30 13:48:23 BST 2015 (1438260503717)
    
    [info] Remote engines have been started
    [info] Waiting for possible shutdown message on port 4445
    

    jenkins 方面有什么问题吗,tomcat webapp?

    【讨论】:

    • 我得到了完全相同的错误no security manager: RMI class loader disabled。我已经用尽了互联网。你知道你到底做了什么来解决它吗?
    • 正如我上面提到的,我通过在 jmeter-server.bat 中定义主机名解决了这个问题但我认为首先你需要检查端口是否没有被从服务器另一侧的防火墙过滤.因此,请按照此链接 [link]jmeter.apache.org/usermanual/remote-test.html 中的说明进行操作
    • 并定义另一个你知道是开放的rmi注册端口和服务器端口。
    【解决方案2】:

    您需要修复的第一件事是服务器地址: https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Remote-Server-Configuration

    10.0.x.100,10.0.x.101 不是正确的 IP 地址。这是您可以在错误日志中看到的内容。

    【讨论】:

    • 由于帖子中的隐私,我编辑了IP地址,所以忽略我发布的内容......我会编辑帖子以免造成混乱。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-10
    • 2020-06-13
    • 1970-01-01
    • 2021-12-03
    • 2012-03-03
    • 1970-01-01
    相关资源
    最近更新 更多