Bug 56602

Summary: serialized test elements lose some properties
Product: JMeter - Now in Github Reporter: Nikolai Grigoriev <ngrigoriev>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED DUPLICATE    
Severity: normal CC: p.mouawad
Priority: P2    
Version: 2.11   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Dummy test with ViewResultsFullVisualizer

Description Nikolai Grigoriev 2014-06-06 19:48:06 UTC
I have recently moved to Jmeter 2.11 from 2.9 and immediately noticed that all of my tests got corrupted. I have verified with one test using the original file and found that it is enough to open and save the test to get it corrupted.

It seems to me that some object properties just simply do not get written to the XML file. I found that it is not only my plug-ins but also some other 3rd party plug-ins suffer.

I did the diff between "before" and "after" saving the JMX file using JMeter and I see a few changes like this:

       <ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="Aggregate Report" enabled="true">
         <boolProp name="ResultCollector.error_logging">false</boolProp>
         <objProp>
-          <name>saveConfig</name>


           <objProp>
-            <name>discreete_buckets</name>
             <value class="java.util.ArrayList">
               <com.mycompany.jmeter.utils.DDRRangeRecord>
-                <probability>50.0</probability>

I started looking at what could be the reason and found that my record class (the one that JMeter eventually serializes) is like this:

public class A implements Serializable {
...
  field A with getter and setter
}

public class B extends A implements Serializable {
  field B with getter and setter
  field C with getter and setter
}

So, fields B and C get serialized, A does not. If I add A to the class B - it works.

With Jmeter 2.9 all A,B and C would be serialized.
Comment 1 Nikolai Grigoriev 2014-06-06 20:08:25 UTC
Created attachment 31694 [details]
Dummy test with ViewResultsFullVisualizer

This is probably one of the test cases. This was created with JMeter 2.9. Open it in 2.11, save and compare with the original. You will see that the element "name" (<name>saveConfig</name>) will disappear from the resulting JMX file.
Comment 2 Nikolai Grigoriev 2014-06-06 20:44:31 UTC
I did some more testing and, unfortunately, found that it was all caused by Java 1.8. With 1.7 it seems to be working correctly. So, the issue is there but it seems to be really caused by JDK 1.8 or compatibility of some libraries with JDK 1.8.
Comment 3 Philippe Mouawad 2014-06-06 21:41:42 UTC
Hello,
We fixed an issue with Java8 , see 56080.
Could you make a test with nightly build:
http://jmeter.apache.org/nightly.html


> Installing JMeter runtime
Download the _bin and _lib files
Unpack the archives into the same directory structure
The other archives are not needed to run JMeter.
Comment 4 Nikolai Grigoriev 2014-06-06 21:44:28 UTC
Will try it, thanks for the hint. I was trying to find the matching existing issue before creating new one but could not come up with appropriate keywords :)
Comment 5 Nikolai Grigoriev 2014-06-06 22:07:26 UTC
Indeed it is a duplicate. I only had to replace xstream-1.4.4.jar with xstream-1.4.6.jar to get it working with jdk 1.8.

*** This bug has been marked as a duplicate of bug 56080 ***
Comment 6 The ASF infrastructure team 2022-09-24 20:37:57 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3383