2
votes

I would like to execute my .jmx program (delevoped on jmeter for windows) on my Ubuntu server but when I launch the following command: jmeter -n -t TestRemote.jmx -l log.jtl I receive this exception in 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

I added jdbc connector for Mysql database to apache-jmeter-2.13\lib on my server. How can i resolve this issue?

EDIT: Adding jdbc connector for mysql to apache-jmeter-2.13\lib\ext I obtain this error:

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)

EDIT: i tried to run a simple code only with BeanShell sampler (log.info("Hello");) and however it didn't work and it threw this exception:

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

this is my jmx program:

<?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>
2
try putting the connector jars in jmeter\lib folder.RaGe
i err to write, i added the connector in lib not in binluca
Are you certain you're using the same version of JMeter on both machines?RaGe
Apache Jmeter Version 2.13 on bothluca

2 Answers

0
votes

Looks like JMeter needs your JDBC classes during start-up. Place your jdbc jars in jmeter\lib\ext folder.

0
votes

I resolved this issue adding ./ before jmeter :

./jmeter -n -t BeanShellSampler.jmx