昨天在使用2.12版本的jmeter时,执行多机负载测试一直报错,最终查明是使用不当的问题,现将详情记录如下,使用jmeter测试java协议脚本时要注意以下几点:

  1. jar包的方式路径一定是这样,否则可能会出现诡异问题:

apache-jmeter

-- lib                 —— 脚本依赖的包放在这里

    -- ext            —— 自己开发脚本(jar文件)放在这里

2. jmeter/lib目录下本身有很多jar包,所以拷贝脚本依赖的jar时一定要小心,千万别和这些jmeter自带的重复,否则也会死的很难看!

附上官方白皮书:

JMeter automatically finds classes from jars in the following directories:

      • JMETER_HOME/lib - used for utility jars
      • JMETER_HOME/lib/ext - used for JMeter components and plugins

If you have developed new JMeter components, then you should jar them and copy the jar into JMeter's lib/ext directory. JMeter will automatically find JMeter components in any jars found here. Do not use lib/ext for utility jars or dependency jars used by the plugins; it is only intended for JMeter components and plugins.

If you don't want to put JMeter plugin jars in the lib/ext directory, then define the property search_paths in jmeter.properties.

Utility and dependency jars (libraries etc) can be placed in the lib directory.

If you don't want to put such jars in the lib directory, then define the property user.classpath or plugin_dependency_paths in jmeter.properties. See below for an explanation of the differences.

Other jars (such as JDBC, JMS implementations and any other support libaries needed by the JMeter code) should be placed in the lib directory - not the lib/extdirectory, or added to user.classpath .

Note: JMeter will only find .jar files, not .zip.

You can also install utility Jar files in $JAVA_HOME/jre/lib/ext, or you can set the property user.classpath in jmeter.properties

Note that setting the CLASSPATH environment variable will have no effect. This is because JMeter is started with "java -jar", and the java command silently ignores the CLASSPATH variable, and the -classpath/-cp options when -jar is used. [This occurs with all Java programs, not just JMeter.]

Jmeter java协议测试jar和依赖jar的路径研究的更多相关文章

  1. Jmeter java协议配置文件导入

    一. 方法一 通过ClassLoader获取当前路径,想在java脚本里读取druid.properties,路径如下 apache-jmeter --bin --druid.properties 相 ...

  2. maven依赖本地非repository中的jar包-依赖jar包放在WEB-INF/lib等目录下的情况客户端编译出错的处理

    MAVEN 今天在使用maven编译打包一个web应用的时候,碰到一个问题: 项目在开发是引入了依赖jar包,放在了WEB-INF/lib目录下,并通过buildpath中将web libariary ...

  3. java命令行执行带依赖jar包的main函数

    有时候客户端没有运行环境,需要将程序放到服务器上执行,可按如下操作: 1.创建libs文件夹,将运行过程中依赖的jar包全部拷贝到此处; 2.编译.执行 javac -Djava.ext.dirs=l ...

  4. jmeter的dubbo压测,依赖jar包要放到执行机的lib/ext下

    对于jmeter的dubbo压测场景的master-slave结构: 即master的jmeter进行任务的下发和报告的生成,slave进行任务的执行 因为dubbo压测需要依赖很多三方jar包,那么 ...

  5. JMeter 压测基础(四)——Java工程测试

    JMeter Java工程测试 1.eclipse中新建工程 2.导入需要的jar包 从JMeter安装目录lib/ext中两个jar包buildPath到Java project中,分别是“Apac ...

  6. jmeter 测试java协议经验总结

    对java协议的良好支持,是jmeter比loadrunner优秀的地方,但是坑也不少,本文将相关点都整理下来备忘 一. 依赖的jar包 使用IDE开发jemter java协议脚本时,需要导入以下几 ...

  7. Java ClassLoader基础及加载不同依赖 Jar 中的公共类

    转载自:最新内容及最清晰格式请见 http://www.trinea.cn/android/java-loader-common-class/ 本文主要介绍 ClassLoader 的基础知识,Cla ...

  8. java打包/命令行方式运行jar(命令行进行程序测试)

    public class Testtmp { public static void main(String[] args) { // TODO Auto-generated method stub f ...

  9. 自动配置pom文件,构建maven项目jar包依赖关系,找到jar包运用到jmeter

    首先说下pom文件特别方便的优点: 什么是pom文件? POM(Project Object Model) 是Maven的基础. 它是一个XML文件,包含了Maven用来build项目所需要的项目配置 ...

随机推荐

  1. spring aop配置及用例说明(2)

    欢迎交流转载:http://www.cnblogs.com/shizhongtao/p/3473362.html 这里先介绍下几个annotation的含义, @Before:表示在切入点之前执行. ...

  2. GDI+

    1, 编译error的话一般是却 #include <comdef.h>#include <Windows.h> Windows.h内会包含Windows.h,但是因为在std ...

  3. Poj 2262 / OpenJudge 2262 Goldbach's Conjecture

    1.Link: http://poj.org/problem?id=2262 http://bailian.openjudge.cn/practice/2262 2.Content: Goldbach ...

  4. TreeView递归取值

    string jingyuan = ""; string jinghui = ""; private void DiGui(TreeNode tn) { if ...

  5. 全面理解BFC

    BFC 已经是一个耳听熟闻的词语了,网上有许多关于 BFC 的文章,介绍了如何触发 BFC 以及 BFC 的一些用处(如清浮动,防止 margin 重叠等).虽然我知道如何利用 BFC 解决这些问题, ...

  6. IE下的bug解决方案

    1.IE6下的双边距bug <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...

  7. mac下安装pcntl

     Now you need to find out what version of PHP is installed on OSX $ php -vPHP 5.3.10 with Suhosin-Pa ...

  8. php总结:1.php介绍

    1.什么是php PHP,即“Hypertext Preprocessor”,是一种被广泛应用的开源通用脚本语言,尤其适用于 Web 开发并可嵌入 HTML 中去.它的语法利用了 C.Java 和 P ...

  9. Intel Edison的那些事:修改Edison的HTTP服务的页面

    Intel Edison配置好之后,按住PWR键2-7秒(4秒恰到好处),就可以进入AP热点模式(此时,Arduino扩展板上的灯不停闪烁),可以将笔记本接入Edison的热点,然后在浏览器中访问“h ...

  10. javascript与DOM的渊源

    1. JavaScript的起源 1.1 JavaScript的诞生与发展 JavaScript最初由Netscape的Brendan Eich设计, Netscape在最初将其脚本语言命名为Live ...