[在线等]LoadRunner Java 报错信息
需求:在LoadRunner Java 中写脚本调用别人jar 中的方法,测试目的:希望多人并发调用的平均时间步骤:将所有涉及的jar 包文件copy 到脚本目录下,将用到的App_config也copy到脚本目录上。
脚本如下:
/*
* LoadRunner Java script. (Build: 759)
*
* Script Description:
*
*/
import lrapi.lr;
import lrapi.web;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
import com.foundation.module.db.Trans;
import com.pub.framework.profile.MonitorFactory;
import com.hh.pub.* .* .*;
import com.*.foundation.module.db.DBean;
import com.*.foundation.module.db.Trans;
public class Actions
{
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
public String rtCodeLogic;
public Map paraLogic;
public String whereConditionLogic;
public int init() throws Exception{
rtCodeLogic = "88888"; //1W
paraLogic = new HashMap();
/*
paraLogic.put("AA", 1);
paraLogic.put("BB", "B1");
*/
Date startDate = dateFormat.parse("2018-01-01");
Date endDate = dateFormat.parse("2020-12-12");
paraLogic.put("start_date", startDate);
paraLogic.put("end_date", endDate);
paraLogic.put("salary", 666888);
paraLogic.put("name", "hh");
paraLogic.put("age", 999);
whereConditionLogic = "";
// init db
DBean db = new DBean();
db.connect();
db.getConnection();
System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
System.out.println(db.getConnection());
System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
//init profiler monitor,avoid log info
MonitorFactory.getMonitor();
return 0;
}//end of init
public int action() throws Exception{
// init db
// Date startime = new Date();
lr.start_transaction("serach");
调用内名.调用方法名字(rtCodeLogic, paraLogic, whereConditionLogic);
//Date endTime = new Date();
// System.out.println("start time:"+startime.getTime());
//System.out.println("endTime:"+endTime.getTime());
lr.end_transaction("serach", lr.PASS);
return 0;
}//end of action
public int end() {
return 0;
}//end of end
}
运行报错信息为 :
Error: Exception was raised when calling per-process-init function in extension java_int.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION
Error: Thread Context: Call to service of the driver failed, reason - thread context wasn't initialized on this thread. 其他JAR 包没调用到? 你用的是JDK1.5吧,需要打个补丁!
页:
[1]