本站消息

站长简介/公众号


站长简介绍:高级工程师,爱好交友,无偿辅导python和前端,技术交流,面试指导,找工作指导,瞎聊都可加我微信i88811i哈,欢迎欢迎!也欢迎加入程序员交流群,专属程序员的圈子,加我微信拉你进群.欢迎关注我的微信公众号:程序员总部,程序员的家,探索程序员的人生之路!分享IT最新技术,关注行业最新动向,让你永不落伍。了解同行们的工资,生活工作中的酸甜苦辣,谋求程序员的最终出路!

  价值13000svip视频教程,java大神匠心打造,零基础java开发工程师视频教程全套,基础+进阶+项目实战,包含课件和源码

  出租广告位,需要合作请联系站长


+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

Ubuntu NO-GUI 上的 JDBC 连接器出现 Jmeter 错误

发布于2022-05-19 07:41     阅读(964)     评论(0)     点赞(20)     收藏(4)


我想在我的 Ubuntu 服务器上执行我的 .jmx 程序(在 jmeter for windows 上开发)但是当我启动以下命令时: jmeter -n -t TestRemote.jmx -l log.jtl 我在 jmeter.log 中收到这个异常

15/04/30 09:39:27 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 2015/04/30 09:39:27 INFO  - jmeter.JMeter: Loading user properties from: /opt/apache-jmeter-2.13/bin/user.properties
2015/04/30 09:39:27 INFO  - jmeter.JMeter: Loading system properties from: /opt/apache-jmeter-2.13/bin/system.properties
2015/04/30 09:39:27 INFO  - jmeter.JMeter: Copyright (c) 1998-2012 The Apache Software Foundation
2015/04/30 09:39:27 INFO  - jmeter.JMeter: Version 2.8.20130705
2015/04/30 09:39:27 INFO  - jmeter.JMeter: java.version=1.7.0_79
2015/04/30 09:39:27 INFO  - jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM
2015/04/30 09:39:27 INFO  - jmeter.JMeter: os.name=Linux
2015/04/30 09:39:27 INFO  - jmeter.JMeter: os.arch=amd64
2015/04/30 09:39:27 INFO  - jmeter.JMeter: os.version=3.13.0-34-generic
2015/04/30 09:39:27 INFO  - jmeter.JMeter: file.encoding=UTF-8
2015/04/30 09:39:27 INFO  - jmeter.JMeter: Default Locale=English (United States)
2015/04/30 09:39:27 INFO  - jmeter.JMeter: JMeter  Locale=English (United States)
2015/04/30 09:39:27 INFO  - jmeter.JMeter: JMeterHome=/usr/share/jmeter
2015/04/30 09:39:27 INFO  - jmeter.JMeter: user.dir  =/opt/apache-jmeter-2.13/bin
2015/04/30 09:39:27 INFO  - jmeter.JMeter: PWD       =/opt/apache-jmeter-2.13/bin
2015/04/30 09:39:27 INFO  - jmeter.JMeter: IP: 10.4x.x.184 Name: jmeter FullName: jmeter.x.x
2015/04/30 09:39:27 INFO  - jmeter.services.FileServer: Default base='/opt/apache-jmeter-2.13/bin'
2015/04/30 09:39:27 INFO  - jmeter.services.FileServer: Set new base='/opt/apache-jmeter-2.13/bin'
2015/04/30 09:39:27 INFO  - jmeter.JMeter: Loading file: TestRemote.jmx
2015/04/30 09:39:27 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2015/04/30 09:39:27 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8
2015/04/30 09:39:27 INFO  - jmeter.save.SaveService: Using SaveService properties file version 1382180
2015/04/30 09:39:27 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.3
2015/04/30 09:39:27 INFO  - jmeter.save.SaveService: All converter versions present and correct
2015/04/30 09:39:27 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: org.apache.jmeter.protocol.jdbc.config.DataSourceElement : org.apache.jmeter.protocol.jdbc.config.DataSourceE$
---- Debugging information ----
message             : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/JDBCDataSource
line number         : 80
------------------------------- : org.apache.jmeter.protocol.jdbc.config.DataSourceElement : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
---- Debugging information ----
message             : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/JDBCDataSource
line number         : 80
-------------------------------
message             : org.apache.jmeter.protocol.jdbc.config.DataSourceElement : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
---- Debugging information ----
message             : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/JDBCDataSource
line number         : 80
-------------------------------
cause-exception     : com.thoughtworks.xstream.converters.ConversionException

我将 Mysql 数据库的 jdbc 连接器添加到服务器上的 apache-jmeter-2.13\lib 中。我该如何解决这个问题?

编辑:将 mysql 的 jdbc 连接器添加到 apache-jmeter-2.13\lib\ext 我收到此错误:

2015/05/04 10:07:36 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US
2015/05/04 10:07:36 INFO  - jmeter.JMeter: Loading user properties from: /opt/apache-jmeter-2.13/bin/user.properties
2015/05/04 10:07:36 INFO  - jmeter.JMeter: Loading system properties from: /opt/apache-jmeter-2.13/bin/system.properties
2015/05/04 10:07:36 INFO  - jmeter.JMeter: Copyright (c) 1998-2012 The Apache Software Foundation
2015/05/04 10:07:36 INFO  - jmeter.JMeter: Version 2.8.20130705
2015/05/04 10:07:36 INFO  - jmeter.JMeter: java.version=1.7.0_79
2015/05/04 10:07:36 INFO  - jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM
2015/05/04 10:07:36 INFO  - jmeter.JMeter: os.name=Linux
2015/05/04 10:07:36 INFO  - jmeter.JMeter: os.arch=amd64
2015/05/04 10:07:36 INFO  - jmeter.JMeter: os.version=3.13.0-34-generic
2015/05/04 10:07:36 INFO  - jmeter.JMeter: file.encoding=UTF-8
2015/05/04 10:07:36 INFO  - jmeter.JMeter: Default Locale=English (United States)
2015/05/04 10:07:36 INFO  - jmeter.JMeter: JMeter  Locale=English (United States)
2015/05/04 10:07:36 INFO  - jmeter.JMeter: JMeterHome=/usr/share/jmeter
2015/05/04 10:07:36 INFO  - jmeter.JMeter: user.dir  =/opt/apache-jmeter-2.13/bin
2015/05/04 10:07:36 INFO  - jmeter.JMeter: PWD       =/opt/apache-jmeter-2.13/bin
2015/05/04 10:07:36 INFO  - jmeter.JMeter: IP: 10.4x.x.184 Name: jmeter FullName: jmeter.x.x
2015/05/04 10:07:36 INFO  - jmeter.services.FileServer: Default base='/opt/apache-jmeter-2.13/bin'
2015/05/04 10:07:36 INFO  - jmeter.services.FileServer: Set new base='/opt/apache-jmeter-2.13/bin'
2015/05/04 10:07:36 INFO  - jmeter.JMeter: Loading file: TestRemote.jmx
2015/05/04 10:07:37 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2015/05/04 10:07:37 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8
2015/05/04 10:07:37 INFO  - jmeter.save.SaveService: Using SaveService properties file version 1382180
2015/05/04 10:07:37 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.3
2015/05/04 10:07:37 INFO  - jmeter.save.SaveService: All converter versions present and correct
2015/05/04 10:07:37 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: org.apache.jmeter.protocol.jdbc.config.DataSourceElement : org.apache.jmeter.protocol.jdbc.config.DataSourceE$
---- Debugging information ----
message             : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/JDBCDataSource
line number         : 80
------------------------------- : org.apache.jmeter.protocol.jdbc.config.DataSourceElement : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
---- Debugging information ----
message             : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/JDBCDataSource
line number         : 80
-------------------------------
message             : org.apache.jmeter.protocol.jdbc.config.DataSourceElement : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
---- Debugging information ----
message             : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.converters.HashTreeConverter
path                : /jmeterTestPlan/hashTree/hashTree/JDBCDataSource
line number         : 80
-------------------------------
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : org.apache.jmeter.protocol.jdbc.config.DataSourceElement : org.apache.jmeter.protocol.jdbc.config.DataSourceElement
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:65)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jorphan.collections.ListedHashTree
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/JDBCDataSource
line number         : 80
version             : 2.8.20130705
-------------------------------
2015/05/04 10:07:37 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.NullPointerException
        at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:93)
        at org.apache.jmeter.JMeter.runNonGui(JMeter.java:745)
        at org.apache.jmeter.JMeter.startNonGui(JMeter.java:723)
        at org.apache.jmeter.JMeter.start(JMeter.java:388)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.jmeter.NewDriver.main(NewDriver.java:216)

编辑:我尝试仅使用 BeanShell 采样器 (log.info("Hello");) 运行一个简单的代码,但是它不起作用并且抛出了这个异常:

2015/05/07 12:28:51 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: org.apache.jmeter.protocol.java.sampler.BeanShellSampler : org.apache.jmeter.protocol.java.sampler.BeanShellSampler

这是我的 jmx 程序:

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">1</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1430993955000</longProp>
        <longProp name="ThreadGroup.end_time">1430993955000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="BeanShell Sampler" enabled="true">
          <stringProp name="BeanShellSampler.query">log.info(&quot;ciao&quot;);</stringProp>
          <stringProp name="BeanShellSampler.filename"></stringProp>
          <stringProp name="BeanShellSampler.parameters"></stringProp>
          <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp>
        </BeanShellSampler>
        <hashTree/>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

解决方案


我在 jmeter 之前添加 ./ 解决了这个问题:

./jmeter -n -t BeanShellSampler.jmx

站长简介:高级工程师,爱好交友,无偿辅导python和前端,技术交流,面试指导,找工作指导,瞎聊都可加我微信i88811i哈,欢迎欢迎!也欢迎加入程序员交流群,专属程序员的圈子,加我微信拉你进群.
欢迎关注我的公众号:程序员总部,关注公众号回复java,免费领取 全套java视频教程,关注公众号回复java充值+你的账号,免费为您充值1000积分



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:http://www.javaheidong.com/blog/article/442848/088583b201592589e676/

来源:java黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

20 0
收藏该文
已收藏

评论内容:(最多支持255个字符)