JMeter:为什么在Windows中记录的脚本在Ubuntu上不起作用?

时间:2016-08-04 06:13:55

标签: windows ubuntu plugins scripting jmeter

我在Windows(JMeter 3.0)中录制了脚本,由于Windows没有处理大量用户,我试图在Ubuntu(JMeter 2.3.4)中使用相同的脚本,但是显示错误弹出窗口:

测试计划出错。请参阅日志文件

日志文件有以下消息:

2016/08/04 11:36:02 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_IN 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: Copyright (c) 1998-2009 The Apache Software Foundation 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: Version 2.3.4 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: java.version=1.6.0_38 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: java.vm.name=OpenJDK Server VM 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: os.name=Linux 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: os.arch=i386 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: os.version=3.5.0-54-generic 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: file.encoding=UTF-8 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: Default Locale=English (India) 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: JMeter  Locale=English (India) 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: JMeterHome=/usr/share/jmeter 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: user.dir  =/home/webwerks 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: PWD       =/home/webwerks 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: IP: 127.0.1.1 Name: BT-R1P7 FullName: BT-R1P7 
2016/08/04 11:36:02 INFO  - jmeter.JMeter: Loaded icon properties from org/apache/jmeter/images/icon.properties 
2016/08/04 11:36:04 INFO  - jmeter.util.BSFTestElement: Registering JMeter version of JavaScript engine as work-round for BSF-22 
2016/08/04 11:36:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: No response parsers defined: text/html only will be scanned for embedded resources 
2016/08/04 11:36:05 INFO  - jmeter.protocol.http.sampler.HTTPSampler: Maximum connection retries = 10 
2016/08/04 11:36:05 INFO  - jmeter.protocol.http.sampler.HTTPSampler: Connection and read timeouts are available on this JVM 
2016/08/04 11:36:06 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are END times 
2016/08/04 11:36:06 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 
2016/08/04 11:36:20 INFO  - jmeter.services.FileServer: Default base=/home/webwerks 
2016/08/04 11:36:20 INFO  - jmeter.gui.action.Load: Loading file: /home/webwerks/Downloads/Abhijeet.jmx 
2016/08/04 11:36:20 INFO  - jmeter.services.FileServer: Set new base=/home/webwerks/Downloads 
2016/08/04 11:36:20 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 
2016/08/04 11:36:20 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
2016/08/04 11:36:20 INFO  - jmeter.save.SaveService: Using SaveService properties file version 697317 
2016/08/04 11:36:20 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.1 
2016/08/04 11:36:20 INFO  - jmeter.save.SaveService: All converter versions present and correct 
2016/08/04 11:36:20 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
------------------------------- : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
-------------------------------
message             : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
-------------------------------
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:81)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
------------------------------- 
2016/08/04 11:36:20 WARN  - jmeter.gui.action.Load: Unexpected error java.lang.Exception: Error in TestPlan - see log file
	at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:153)
	at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:108)
	at org.apache.jmeter.gui.action.Load.doAction(Load.java:89)
	at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
	at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:42)
	at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:59)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:685)
	at java.awt.EventQueue.access$400(EventQueue.java:96)
	at java.awt.EventQueue$2.run(EventQueue.java:646)
	at java.awt.EventQueue$2.run(EventQueue.java:644)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:655)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

2016/08/04 11:37:13 INFO  - jmeter.gui.action.Load: Loading file: /home/webwerks/Downloads/Abhijeet.jmx 
2016/08/04 11:37:13 INFO  - jmeter.services.FileServer: Set new base=/home/webwerks/Downloads 
2016/08/04 11:37:13 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
------------------------------- : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
-------------------------------
message             : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
-------------------------------
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:81)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
------------------------------- 
2016/08/04 11:37:13 WARN  - jmeter.gui.action.Load: Unexpected error java.lang.Exception: Error in TestPlan - see log file
	at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:153)
	at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:108)
	at org.apache.jmeter.gui.action.Load.doAction(Load.java:89)
	at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
	at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:42)
	at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:59)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:685)
	at java.awt.EventQueue.access$400(EventQueue.java:96)
	at java.awt.EventQueue$2.run(EventQueue.java:646)
	at java.awt.EventQueue$2.run(EventQueue.java:644)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:655)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

2016/08/04 11:37:50 INFO  - jmeter.gui.action.Load: Loading file: /home/webwerks/Downloads/Abhijeet.jmx 
2016/08/04 11:37:50 INFO  - jmeter.services.FileServer: Set new base=/home/webwerks/Downloads 
2016/08/04 11:37:50 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
------------------------------- : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
-------------------------------
message             : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
-------------------------------
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:81)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/HTTPSamplerProxy
line number         : 40
------------------------------- 
2016/08/04 11:37:50 WARN  - jmeter.gui.action.Load: Unexpected error java.lang.Exception: Error in TestPlan - see log file
	at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:153)
	at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:108)
	at org.apache.jmeter.gui.action.Load.doAction(Load.java:89)
	at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
	at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:42)
	at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:59)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:685)
	at java.awt.EventQueue.access$400(EventQueue.java:96)
	at java.awt.EventQueue$2.run(EventQueue.java:646)
	at java.awt.EventQueue$2.run(EventQueue.java:644)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:655)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

是否由于两个操作系统中的JMeter版本不匹配而发生这种情况?如果这是真的,我之前在Windows中使用了在Ubuntu中创建的脚本。

注意:脚本仅包含所有内置功能,未添加任何额外插件。

1 个答案:

答案 0 :(得分:1)

JMeter 2.3.4已有7年历史,从那时起,很多东西都发生了变化。每个新版本都会带来一些不兼容的更改。您需要在Ubuntu系统上升级JMeter。

  1. 下载最新的Java SDK from Oracle website(目前是Java 8)并将其解压缩到某个地方,即/opt/java
  2. 下载最新JMeter from Apache website(目前是JMeter 3.0)并将其提取到某个地方,即/opt/jmeter
  3. JAVA_HOME变量设置为/opt/java(或您在步骤1中选择的任何文件夹)

    JAVA_HOME=/opt/java && export JAVA_HOME
    
  4. 添加Java SDK" bin"文件夹到系统路径

    PATH=$JAVA_HOME/bin:$PATH && export PATH
    
  5. 启动JMeter(确保启动JMeter 3.0,而不是Ubuntu附带的那个),如

    cd /opt/jmeter/bin
    ./jmeter
    
  6. 我还建议您考虑升级到64位操作系统和JDK,因为您无法使用> 4 GB(通常甚至更少)的堆空间因此您将能够创建的负载将非常有限。有关此提示和其他提示的详细说明,请参阅9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure文章。

相关问题