SanchelliosProg
SanchelliosProg

Reputation: 2331

Can not open jmeter 5.2.1 - getting org.apache.jorphan.collections.ListedHashTree cannot be cast to org.apache.jmeter.testelement.TestElement

jmeter version 5.2.1 Error message: org.apache.jorphan.collections.ListedHashTree cannot be cast to org.apache.jmeter.testelement.TestElement

Just like: enter image description here

Previously had got such error:

Problem loading XML from:'/Users/user/repositories/rep/file.jmx'. 
Cause:
NullPointerException: 

 Detail: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[15]/HTTPSamplerProxy
line number         : 1243
version             : 5.2.1
-------------------------------

That was simply fixed by deleting <HTTPSamplerProxy/> in XML of project on line 1243

What could I do with such error?

Upvotes: 0

Views: 2882

Answers (1)

Dmitri T
Dmitri T

Reputation: 168122

Your .jmx script is malformed somehow, the reasons could be in:

  1. It was corrupt by someone who was manually editing the .jmx. It would be hard/impossible to recover without seeing the full file.

  2. You're using wrong JMeter version to open the file, if you look at 2nd line of the .jmx script it should contain jmeter tag with the version of JMeter like:

    <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.3">
    

    try opening the file with the exact JMeter version specified in the .jmx script

  3. The file is generated by a 3rd-party tool which assumes previous JMeter versions syntax so you need to check what exact version it is supposed to be as there could be incompatible changes

  4. Test plan contains 3rd-party plugins which are not installed

It's hard to state where exactly the problem is without seeing your .jmx script, if you cannot provide the script increase JMeter logging verbosity by adding the next line to log4j2.xml file:

<Logger name="org.apache.jmeter" level="debug" /> 

it might be the case either you or we'll be able to figure out the root cause from the log

Upvotes: 1

Related Questions