简体   繁体   English

-Guser.classpath=arhivo.jar 不是 load.jar

[英]-Guser.classpath=arhivo.jar not load .jar

I am using JMeter 5.0 mode no GUI and OpenJDK Runtime Environment Corretto-8.322.06.1 (build 1.8.0_322-b06)我正在使用 JMeter 5.0 模式,没有 GUI 和 OpenJDK 运行时环境 Corretto-8.322.06.1 (build 1.8.0_322-b06)

jmeter.bat -f -Ghilos=1 -Gsubida=1 -Gciclo=1 -GDatosCajero=DT_TramasATMPropios.csv -Guser.classpath=trama.jar -n -LERROR -t Cajeros_distribuidos.jmx -l result.csv -Djmeter.save.saveservice.output_format=csv -Ljmeter.engine=DEBUG

error parameter错误参数

-Guser.classpath=file.jar 

take parameters globally in jmeter.log在jmeter.log中全局取参数

INFO oajJMeter: Setting Global property: user.classpath=trama.jar信息 oajJMeter:设置全局属性:user.classpath=trama.jar

Jmeter.log Jmeter.log文件

error错误

ERROR oajuBeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import Cajeros.RecepcionParametrosCajeros;错误 oajuBeanShellInterpreter:调用 bsh 方法时出错:eval 源文件:内联评估:``import Cajeros.RecepcionParametrosCajeros; import java.util.concurrent.ThreadLoc.导入 java.util.concurrent.ThreadLoc。 . . . . '': Typed variable declaration: Class: RecepcionParametrosCajeros not found in namespace '':类型化变量声明:类:在命名空间中找不到 RecepcionParametrosCajeros

property in the non-GUI JMeter command, but it does not take the.jar, when I use the property with非 GUI JMeter 命令中的属性,但是当我将属性与

-Juser.classpath=file.jar

if it takes it, it also takes the rego global variables with -G如果它接受它,它也会接受带 -G 的 rego 全局变量

work globally with -G for distributed testing在全球范围内使用 -G 进行分布式测试

I cannot reproduce your issue using the following dummy simple class:我无法使用以下虚拟简单类重现您的问题:

package Cajeros;

public class RecepcionParametrosCajeros {

    public RecepcionParametrosCajeros() {

    }

    public String foo() {
        return "foo";
    }
}

importing the jar as:将 jar 导入为:

jmeter -Juser.classpath=trama.jar

and invoking it like:并像这样调用它:

import Cajeros.RecepcionParametrosCajeros;

String foo = new RecepcionParametrosCajeros().foo();

log.info("Got string " + foo);

So double check that the file is present in JMeter's "bin" directory所以仔细检查该文件是否存在于 JMeter 的“bin”目录中

More information:更多信息:

Also be aware of the following recommendations:另请注意以下建议:

  1. Always use the latest version of JMeter , consider migrating to JMeter 5.5 始终使用最新版本的 JMeter ,考虑迁移到JMeter 5.5
  2. Since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting. 从 JMeter 3.1 开始,建议使用 JSR223 测试元素和 Groovy 语言编写脚本。 It might also resolve your problem as Beanshell is not 100% Java compatible and you may face problems with generics, inner classes, features introduced after Java 5 and so on.它也可能解决您的问题,因为 Beanshell 不是 100% Java 兼容的,您可能会遇到泛型、内部类、Java 5 之后引入的功能等问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM