Search code examples
javassljmeteractivemq-artemis

Run JMeter test on AWS ec2 instance (ubuntu)


I am trying to set up JMeter tests in AWS on an EC2 (t2.micro) instance to run them on cmd. Therefore I wanted to use this git project: https://github.com/r4dx/terraform-aws-jmeter.

As I am new to terraform and have just basic knowledge of aws, I went step by step. So for first attempts I let the autoscaling group away and want to reach, that I can run one test against another ec2 instance, where there is the artemis broker and some applications running as a cluster.

The ec2 instance is running and has JMeter 3.3 installed. So far I added the test itself as well as the truststore.jks to /bin and a driver for artemis to the /lib folder (artemis-jms-client-all-2.15.0.jar).

When I execute "jmeter -n -t Artemis_AWS.jmx -j jmeterlogfile" I am getting following error:

WARNING: An illegal reflective access operation has occurred 
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields file:/usr/share/java/xstream.jar) to field java.util.TreeMap.comparator 
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields    
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations 
WARNING: All illegal access operations will be denied in a future release Security framework of XStream not initialized, XStream is probably vulnerable. 
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/jmeter-master/apache-jmeter-3.3/bin/Artemis_AWS.jmx', conversion error com.thoughtworks.xstream.converters.ConversionException: 
---- Debugging information ---- 
cause-exception : com.thoughtworks.xstream.converters.ConversionException 
cause-message : 
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)    
class               : org.apache.jmeter.save.ScriptWrapper    
required-type       : org.apache.jmeter.save.ScriptWrapper    
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter    
path                :   jmeterTestPlan/hashTree/hashTree/hashTree[2]/PublisherSampler 
line number         : 140 
version             : 2.13.20170723    -------------------------------

This is what is in line 140 of the jmx file:

<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" 
  testname="tableNumber-100" enabled="true">
  <stringProp name="variableName">tableNumber</stringProp>
  <stringProp name="outputFormat">000</stringProp>
  <stringProp name="minimumValue">100</stringProp>
  <stringProp name="maximumValue">200</stringProp>
  <stringProp name="randomSeed">100</stringProp>
  <boolProp name="perThread">false</boolProp>
</RandomVariableConfig>                             <------ line 140
<hashTree/>

Solution

  • According to the log file you're running JMeter 2.13, not JMeter 3.3:

    version : 2.13.20170723 ------------------------------- ^^^^

    And Random Variable element is available since JMeter 2.3.3 so you need to upgrade your JMeter to at least 2.3.3 or higher in order to be able to use this config element.

    Ubuntu has JMeter 2.13 in its repositories which is kind of old so you need to download whatever version you need from JMeter Downloads page and install it manually

    More information: How to Get Started With JMeter: Installation & Test Plans

    In general according to JMeter Best Practrices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.3 instead of 3.3 which is kind of old as well.