问题:Jmeter中引入自己写的Jar包,使用maven,在Eclipse上测试正常,但是运行时提示导入jar包报错,如下
jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import com.stu.demo.companyTest.GetToken; import java.util.*; Map params = new H . . . '' : Typed variable declaration : Method Invocation getToken.getMerchantsURL
解决办法:
1、右键点击项目:Export…
2、选择Java -> Runnable JAR file(注意:这里导出的是 runnable Jar,这样的话依赖的类也可以打进去。强调下:虽然必须有main方法,但实际在jmeter执行过程中 main方法不执行)