Bug 58679 - Replace the xpp pull parser in xstream with a java6+ standard solution
Summary: Replace the xpp pull parser in xstream with a java6+ standard solution
Status: REOPENED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.13
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-02 09:31 UTC by benoit.wiart
Modified: 2016-04-27 18:42 UTC (History)
1 user (show)



Attachments
Logs with exception (23.05 KB, application/force-download)
2016-04-14 19:04 UTC, Milamber
Details
Simple test plan with special data which don't parse with the commits of 58679 (20.36 KB, application/xml)
2016-04-14 19:05 UTC, Milamber
Details
A new script generate by trunk without 58679 (but don't works for open with trunk) (18.99 KB, application/xml)
2016-04-14 20:17 UTC, Milamber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description benoit.wiart 2015-12-02 09:31:13 UTC
in current jmeter version xstream use the xpp library to provide the xml pull parser functionality.
Since Java6 it's possible to use the xstream staxDriver which does not need the xpp library

See http://x-stream.github.io/tutorial.html#init

PR will follow.

Testing was done with the jmeter test suite + local tests
Comment 1 benoit.wiart 2015-12-02 09:33:23 UTC
PR https://github.com/apache/jmeter/pull/35
Comment 2 Philippe Mouawad 2015-12-02 12:24:11 UTC
Date: Wed Dec  2 12:23:11 2015
New Revision: 1717619

URL: http://svn.apache.org/viewvc?rev=1717619&view=rev
Log:
Bug 58679 - Replace the xpp pull parser in xstream with a java6+ standard solution
Bugzilla Id: 58679

Removed:
    jmeter/trunk/licenses/bin/xmlpull-1.1.3.1.txt
    jmeter/trunk/licenses/bin/xpp3-1.1.4c.txt
Modified:
    jmeter/trunk/build.properties
    jmeter/trunk/build.xml
    jmeter/trunk/eclipse.classpath
    jmeter/trunk/lib/aareadme.txt
    jmeter/trunk/res/maven/ApacheJMeter_parent.pom
    jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
    jmeter/trunk/xdocs/changes.xml
Comment 3 Philippe Mouawad 2015-12-02 12:29:12 UTC
Date: Wed Dec  2 12:27:48 2015
New Revision: 1717621

URL: http://svn.apache.org/viewvc?rev=1717621&view=rev
Log:
Bug 58679 - Replace the xpp pull parser in xstream with a java6+ standard solution
Bugzilla Id: 58679

Modified:
    jmeter/trunk/lib/   (props changed)
Comment 4 Philippe Mouawad 2015-12-11 19:54:30 UTC
Date: Fri Dec 11 19:49:27 2015
New Revision: 1719512

URL: http://svn.apache.org/viewvc?rev=1719512&view=rev
Log:
Bug 58679 Replace the xpp pull parser in xstream with a java6+ standard solution.
Bugzilla Id: 58679

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java
Comment 5 Milamber 2016-04-14 19:04:12 UTC
I found a regression (I thinks) with this change.

2016/04/14 19:16:43 WARN  - jmeter.gui.action.Load: Unexpected error java.lang.IllegalArgumentException: Problem loading XML from:'/tmp/Scripts-JMeter/03_Issue.jmx', missing class com.thoughtworks.xstream.converters.ConversionException:  : ParseError at [row,col]:[32,44]
Message: Character reference "&# :  : ParseError at [row,col]:[32,44]
Message: Character reference "&#

see log in attachment.


I cannot open this script jmx (in attachment) with latest trunk (error above), but it's works with JMeter 2.13.
If I return just before the commits about 58679, it's works.
It I revert only the commits from trunk (with git), It's works too.

This bug blocks the next release 3.0.
Comment 6 Milamber 2016-04-14 19:04:53 UTC
Created attachment 33765 [details]
Logs with exception
Comment 7 Milamber 2016-04-14 19:05:57 UTC
Created attachment 33766 [details]
Simple test plan with special data which don't parse with the commits of 58679
Comment 8 Felix Schumacher 2016-04-14 19:23:45 UTC
This post seems to be about the same error:
http://stackoverflow.com/questions/13054594/xstream-does-not-deserialize-
back-from-xml

� is not a valid xml 1.0 entity. So the parser has the right to refuse such a file. :(
Comment 9 Philippe Mouawad 2016-04-14 19:29:13 UTC
Hi,
If you open it in Firefox for example it gives the same error.
Regards
Comment 10 Milamber 2016-04-14 19:43:19 UTC
Ok but why it's works with JMeter 2.13 (or without this change)
Comment 11 Milamber 2016-04-14 19:46:29 UTC
It's was created by JMeter proxy element, 3.0 SNAPSHOT (20160406).

Record and save the script works, but in the same version, open the script don't.

Regression in the save action service? if the � isn't a good entity.?
Comment 12 Milamber 2016-04-14 20:08:01 UTC
I have a recording session from the original record (in a jtl file)


<httpSample t="0" it="0" lt="0" ct="0" ts="1459960789816" s="false" lb="162 /UploadData.aspx" rc="Non HTTP response code: java.lang.IllegalArgumentException" rm="Non HTTP response message: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: &quot;&#x1;&#x0;&quot;" tn="" dt="text" de="" by="694" sc="1" ec="1" ng="0" na="0" hn="ender">
  <responseHeader class="java.lang.String"></responseHeader>
  <requestHeader class="java.lang.String"></requestHeader>
  <responseData class="java.lang.String">java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: &quot;&#x1;&#x0;&quot;
	at java.net.URLDecoder.decode(URLDecoder.java:194)
	at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:1270)
	at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.handleMethod(HTTPHC4Impl.java:504)
	at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:322)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
	at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:240)
</responseData>
  <responseFile class="java.lang.String"></responseFile>
  <cookies class="java.lang.String"></cookies>
  <method class="java.lang.String">POST</method>
  <queryString class="java.lang.String"></queryString>
  <java.net.URL>http://ssw.live.com/UploadData.aspx</java.net.URL>
</httpSample>




<httpSample t="787" it="0" lt="787" ct="325" ts="1459960789840" s="true" lb="163 /UploadData.aspx" rc="200" rm="OK" tn="" dt="" de="" by="178" sc="1" ec="0" ng="0" na="0" hn="ender">
  <responseHeader class="java.lang.String">HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 0
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 06 Apr 2016 16:39:49 GMT
</responseHeader>
  <requestHeader class="java.lang.String">Connection: keep-alive
User-Agent: MSDW
Content-Type: application/x-www-form-urlencoded
Content-Length: 5243
Host: ssw.live.com
</requestHeader>
  <responseData class="java.lang.String">Non-TEXT response data, cannot record: ()</responseData>
  <responseFile class="java.lang.String"></responseFile>
  <cookies class="java.lang.String"></cookies>
  <method class="java.lang.String">POST</method>
  <queryString class="java.lang.String">MSQMx%00%00%00%00%00%00%00%129%23%C3%B0%03%00%00%00%C3%92%06%00%00M%00%00%00%02%00%10%00%01%00%00%00%00%00%00%00%60m%C3%9F%C3%AF%22%C2%90%C3%91%01%00%00%00%00%00%00%00%00%60%C3%A7%02%C3%97+%C2%90%C3%91%01P%C3%95%C3%9C%C3%AF%22%C2%90%C3%91%01k%1C%2F+%C3%86%C3%B5%60I%C2%AC%02%C2%AD%C3%89a%3E%C3%91%1C%C2%A35%C2%98%7B%C3%9BQ%C3%B6%40%C2%BEYC3l%C2%A2%C3%B7=&amp;%00%00%00%00%02%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00l%00%00%00%02%00%00%00%00%00%00%00%00%00%00%00%03%00%00%00%00%00%0A%00%00%00%00%00%04%00%00%00%01%00%00%00%00%00%00%00%05%00%00%00Z%29%00%00%00%00%00%00%06%00%00%00%00%00%00%00%00%00%00%00%07%00%00%000%00%00%00%00%00%00%00%10%00%00%00%01%09%00%0A%00%00%00%00%11%00%00%00%02%00%00%00%00%00%00%00%C3%A8%03%00%00%0F%00%00%00O%C2%BE%0D%00%03%00%00%00r%03%00%00%01%00%00%00%00%00%00%00+%00%00%008%003%00C%000%008%002%00D%00B%003%00E%001%005%004%00B%001%006%008%001%00B%00F%00B%005%008%001%008%003%003%000%00C%00E%00A%00C%00%00%00%00%00%08%00%00%00%00%00%00%00%05%00%00%00%28%00N%00%2F%00A%00%29%00%00%00%00%00%09%00%00%00%00%00%00%00%0E%00%00%001%007%00.%003%00.%006%003%000%002%00.%000%002%002%005%00%00%00%00%00%0A%00%00%00%00%00%00%00%05%00%00%00%28%00N%00%2F%00A%00%29%00%00%00%00%00%0B%00%00%00%00%00%00%00%05%00%00%00%28%00N%00%2F%00A%00%29%00%00%00%00%00%0C%00%00%00%00%00%00%00%05%00%00%00f%00r%00-%00F%00R%00%00%00%00%00%0D%00%00%00%00%00%00%00%05%00%00%00%28%00N%00%2F%00A%00%29%00%00%00%00%00%0E%00%00%00%00%00%00%00%05%00%00%00%28%00N%00%2F%00A%00%29%00%00%00%00%00%0F%00%00%00%00%00%00%00%05%00%00%00%28%00N%00%2F%00A%00%29%00%00%00%00%00%12%00%00%00%00%00%00%00%05%00%00%00%28%00N%00%2F%00A%00%29%00%00%00%00%00%13%00%00%00%00%00%00%00%05%00%00%00%28%00N%00%2F%00A%00%29%00%00%00%00%00%14%00%00%00%00%00%00%00%01%00%00%000%00%00%00%00%00%21%00%00%00%00%00%00%00%04%00%00%00p%00r%00o%00d%00%00%00%00%00=&amp;%00%00%00%00%00%00%00%24%00%00%00d%003%006%001%00a%00a%00c%009%00-%003%003%00c%000%00-%005%00a%00a%002%00-%003%006%009%007%00-%006%00f%009%006%008%002%00d%009%00c%004%000%003%00%00%00%00%00%C2%87%0F%03%00%00%00%00%00%01%00%00%00%23%00%00%00%00%00%C2%8C%0F%03%00%00%00%00%00%0E%00%00%001%006%00.%000%00.%006%007%000%001%00.%001%000%001%003%00%00%00%00%00%C2%A1%0F%03%00%00%00%00%00%24%00%00%00d%003%006%001%00a%00a%00c%009%00-%003%003%00c%000%00-%005%00a%00a%002%00-%003%006%009%007%00-%006%00f%009%006%008%002%00d%009%00c%004%000%003%00%00%00%00%00%C2%A2%0F%03%00%00%00%00%00%10%00%00%00O%00n%00e%00D%00r%00i%00v%00e%00C%00o%00n%00s%00u%00m%00e%00r%00%00%00%00%00%C2%A3%0F%03%00%00%00%00%00%24%00%00%000%000%000%000%000%000%000%000%00-%000%000%000%000%00-%000%000%000%000%00-%000%000%000%000%00-%000%000%000%000%000%000%000%000%000%000%000%000%00%00%00%00%00%C2%B0%0F%03%00%00%00%00%00%06%00%00%00%28%00n%00u%00l%00l%00%29%00%00%00%00%00%C2%B2%0F%03%00%00%00%00%00%05%00%00%00*%00*%00*%00*%00*%00%00%00%00%00%C2%B3%0F%03%00%00%00%00%00%05%00%00%00*%00*%00*%00*%00*%00%00%00%00%00%C2%B4%0F%03%00%00%00%00%00%06%00%00%00%28%00n%00u%00l%00l%00%29%00%00%00%00%00%05%00%00%00%C3%9C%02%00%00%C2%95%0F%03%00%02%00%00%00%3C%00%00%00%00%00%00%00%3F4%00%00%00%00%00%00%00%00%00%00%3F4%00%00%40u%00%00%00%00%00%00%7F%C2%A9%00%00%00%00%00%00%00%00%00%00%7F%C2%A9%00%00%40u%00%00%00%00%00%00%C2%AF%1E%01%00%00%00%00%00%00%00%00%00%C2%AF%1E%01%000u%00%00%00%00%00%00%C3%AE%C2%93%01%00%00%00%00%00%00%00%00%00%C3%AE%C2%93%01%00%3Fu%00%00%00%00%00%00.%09%02%00%00%00%00%00%00%00%00%00.%09%02%00%40u%00%00%00%00%00%00m%7E%02%00%00%00%00%00%00%00%00%00m%7E%02%00%3Fu%00%00%00%00%00%00%C2%9D%C3%B3%02%00%00%00%00%00%00%00%00%00%C2%9D%C3%B3%02%000u%00%00%00%00%00%00%C3%9Dh%03%00%00%00%00%00%00%00%00%00%C3%9Dh%03%00%40u%00%00%00%00%00%00%0D%C3%9E%03%00%00%00%00%00%00%00%00%00%0D%C3%9E%03%000u%00%00%00%00%00%00MS%04%00%00%00%00%00%00%00%00%00MS%04%00%40u%00%00%00%00%00%00%C2%8C%C3%88%04%00%00%00%00%00%00%00%00%00%C2%8C%C3%88%04%00%3Fu%00%00%00%00%00%00%C2%BC=%05%00%00%00%00%00%00%00%00%00%C2%BC%3D%05%000u%00%00%00%00%00%00%C3%AC%C2%B2%05%00%00%00%00%00%00%00%00%00%C3%AC%C2%B2%05%000u%00%00%00%00%00%00%2C%28%06%00%00%00%00%00%00%00%00%00%2C%28%06%00%40u%00%00%00%00%00%00l%C2%9D%06%00%00%00%00%00%00%00%00%00l%C2%9D%06%00%40u%00%00%00%00%00%00%C2%AB%12%07%00%00%00%00%00%00%00%00%00%C2%AB%12%07%00%3Fu%00%00%00%00%00%00%C3%AB%C2%87%07%00%00%00%00%00%00%00%00%00%C3%AB%C2%87%07%00%40u%00%00%00%00%00%00%1B%C3%BD%07%00%00%00%00%00%00%00%00%00%1B%C3%BD%07%000u%00%00%00%00%00%00Zr%08%00%00%00%00%00%00%00%00%00Zr%08%00%3Fu%00%00%00%00%00%00%C2%8A%C3%A7%08%00%00%00%00%00%00%00%00%00%C2%8A%C3%A7%08%000u%00%00%00%00%00%00%C2%BA%5C%09%00%00%00%00%00%00%00%00%00%C2%BA%5C%09%000u%00%00%00%00%00%00%C3%AA%C3%91%09%00%00%00%00%00%00%00%00%00%C3%AA%C3%91%09%000u%00%00%00%00%00%00*G%0A%00%00%00%00%00%00%00%00%00*G%0A%00%40u%00%00%00%00%00%00j%C2%BC%0A%00%00%00%00%00%00%00%00%00j%C2%BC%0A%00%40u%00%00%00%00%00%00%C2%9A1%0B%00%00%00%00%00%00%00%00%00%C2%9A1%0B%000u%00%00%00%00%00%00%C3%99%C2%A6%0B%00%00%00%00%00%00%00%00%00%C3%99%C2%A6%0B%00%3Fu%00%00%00%00%00%00%09%1C%0C%00%00%00%00%00%00%00%00%00%09%1C%0C%000u%00%00%00%00%00%00I%C2%91%0C%00%00%00%00%00%00%00%00%00I%C2%91%0C%00%40u%00%00%00%00%00%00%C2%89%06%0D%00%00%00%00%00%00%00%00%00%C2%89%06%0D%00%40u%00%00%00%00%00%00%C2%B9%7B%0D%00%00%00%00%00%00%00%00%00%C2%B9%7B%0D%000u</queryString>
  <java.net.URL>http://ssw.live.com/UploadData.aspx</java.net.URL>
</httpSample>
Comment 13 Milamber 2016-04-14 20:16:07 UTC

I can reproduce the ssw.live.com request (on a Win 10), just wait some minutes after have configure JMeter as the proxy of machine.

With a trunk JMeter version *without* the commits of 58679, it's works, I can save, close and (re)open the script (in attachment)
Comment 14 Milamber 2016-04-14 20:17:45 UTC
Created attachment 33767 [details]
A new script generate by trunk without 58679 (but don't works for open with trunk)
Comment 15 Philippe Mouawad 2016-04-14 20:53:11 UTC
Hi,
Issue is either in XStream using StaxDriver or in Java.
I created a test case and submitted:

- https://github.com/x-stream/xstream/issues/51

Meanwhile, I suggest we revert the bug code to avoid blocking release.

Regards
Comment 16 Philippe Mouawad 2016-04-14 21:32:09 UTC
Hi,
Jörg from XStream already answered:
https://github.com/x-stream/xstream/issues/51#issuecomment-210155359


So I think we should for now revert then implement what's here:
- http://x-stream.github.io/faq.html#XML_null_char
Comment 17 Milamber 2016-04-15 07:23:29 UTC
URL: http://svn.apache.org/viewvc?rev=1739240&view=rev
Log:
Revert Bugzilla 58679 - A character of value 0 is not valid as part of XML, but it's was written by xpp3.
This closes #197
Bugzilla Id: 58679

Added:
    jmeter/trunk/licenses/bin/xmlpull-1.1.3.1.txt   (with props)
    jmeter/trunk/licenses/bin/xpp3-1.1.4c.txt   (with props)
Modified:
    jmeter/trunk/LICENSE
    jmeter/trunk/build.properties
    jmeter/trunk/build.xml
    jmeter/trunk/eclipse.classpath
    jmeter/trunk/lib/   (props changed)
    jmeter/trunk/lib/aareadme.txt
    jmeter/trunk/res/maven/ApacheJMeter_parent.pom
    jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
    jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java
    jmeter/trunk/xdocs/changes.xml