gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 19:15:35 25 4
gpt4 key购买 nike

我已经在 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 中使用过 Script,它是在 Ubuntu 中创建的。

注意:脚本只有所有的内置功能,没有添加任何额外的插件。

最佳答案

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

  • 下载最新Java SDK from Oracle website (目前是 Java 8)并将其提取到某处,即到 /opt/java
  • 下载最新JMeter from Apache website (目前是 JMeter 3.0)并将其提取到某处,即 /opt/jmeter
  • 设置 JAVA_HOME可变为 /opt/java (或您在步骤 1 中选择的任何文件夹)
    JAVA_HOME=/opt/java && export JAVA_HOME
  • 将 Java SDK“bin”文件夹添加到系统 PATH
    PATH=$JAVA_HOME/bin:$PATH && export PATH
  • 启动 JMeter(确保启动 JMeter 3.0,而不是 Ubuntu 自带的),比如
    cd /opt/jmeter/bin
    ./jmeter

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

    关于windows - JMeter:为什么在 Windows 中录制的脚本在 Ubuntu 上不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38759725/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com