【发布时间】:2016-09-24 15:07:07
【问题描述】:
我在使用 Jmeter BeanShell 预处理器时遇到问题。 该脚本调用我将它们放在目录“D:\Software\apache-jmeter-3.0\lib\ext”下的 jar。 enter image description here
这是我的 BeanShell 代码:
import com.evergrande.api.test.JsonClientUtil;
import com.evergrande.common.utils.JsonUtil;
import com.fasterxml.jackson.databind.node.ObjectNode;
JsonClientUtil jcu=new JsonClientUtil();
ObjectNode node = JsonUtil.createObjectNode();//when I try to use the method in JsonUtil(Class),it came out error
错误:
2016/09/24 22:48:06 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import com.evergrande.api.test.JsonClientUtil; import com.evergrande.common.util . . . '' : Typed variable declaration : Method Invocation JsonUtil.createObjectNode
2016/09/24 22:48:06 WARN - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import com.evergrande.api.test.JsonClientUtil; import com.evergrande.common.util . . . '' : Typed variable declaration : Method Invocation JsonUtil.createObjectNode
我可以在我的 java 代码中调用“createObjectNode”方法。 那么,我该如何解决这个问题呢?谢谢大家。
【问题讨论】: