This is tested with 3.0 and also the trunk from SVN. I have %pa% at body data of HTTP Request sampler. When I try to view it with Results Tree, the result is not shown at all. Instead I get the exception below. The problem is that quite many desktop applications are using HTTP(S) POST messages to transport the application specific data to the server. Those can violate the http-protocol. In my opinion the tree view (and others) should be able to show the results even at that case. Exception: 2016/06/16 07:48:03 WARN - jmeter.protocol.http.visualizers.RequestViewHTTP: Error decoding query, maybe your request parameters should be encoded:%pa% java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "pa" at java.net.URLDecoder.decode(Unknown Source) at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.decodeQuery(RequestViewHTTP.java:347) at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.getQueryMap(RequestViewHTTP.java:301) at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.setSamplerResult(RequestViewHTTP.java:223) at org.apache.jmeter.visualizers.RequestPanel.setSamplerResult(RequestPanel.java:109) at org.apache.jmeter.visualizers.SamplerResultTab.setupTabPane(SamplerResultTab.java:229) at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.valueChanged(ViewResultsFullVisualizer.java:263) at javax.swing.JTree.fireValueChanged(Unknown Source) at javax.swing.JTree$TreeSelectionRedirector.valueChanged(Unknown Source) at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(Unknown Source) at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Unknown Source) at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(Unknown Source) at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(Unknown Source) at javax.swing.JTree.setSelectionPath(Unknown Source) at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(Unknown Source) at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(Unknown Source) at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
The problem is at the code snippet below. Returning null when the decoding fails for IllegalArgumentExpcetion prevents showing the message at all. I'd change this to return non-decoded query. I've attached the diff about that modification. It didn't add any new unit test error messages. public static String decodeQuery(String query) { if (query != null && query.length() > 0) { try { query = URLDecoder.decode(query, CHARSET_DECODE); // better ISO-8859-1 than UTF-8 } catch(IllegalArgumentException e) { log.warn("Error decoding query, maybe your request parameters should be encoded:" + query, e); return null; } catch (UnsupportedEncodingException uee) { log.warn("Error decoding query, maybe your request parameters should be encoded:" + query, uee); return null; } return query; } return null; }
Created attachment 33954 [details] Patch which fixes the issue
*** Bug 59714 has been marked as a duplicate of this bug. ***
Thanks for your contribution. Date: Tue Jun 21 18:14:22 2016 New Revision: 1749583 URL: http://svn.apache.org/viewvc?rev=1749583&view=rev Log: Display original query in RequestViewHTTP when decoding fails. Based on patch by Teemu Vesala (teemu.vesala at qentinel.com) Bugzilla Id: 59712 Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java jmeter/trunk/xdocs/changes.xml
*** Bug 59808 has been marked as a duplicate of this bug. ***
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4003