Bug 59714

Summary: NullPointerException when View Result Tree & follow redirects
Product: JMeter Reporter: Pawel <przeszotek>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Use the original query when decoding of it fails

Description Pawel 2016-06-17 07:51:40 UTC
When I want to view response of HTTP Sampler, that has enabled folow redirects (and there are redirects in this request), the Sampler Result, Request details and Response Data of last request is not displayed, in console I get message:

Uncaught Exception java.lang.NullPointerException. See log file for details.

and in jmeter.log there is stack trace:

2016/06/17 09:44:24 ERROR - jmeter.JMeter: Uncaught exception:  java.lang.NullPointerException
	at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.getQueryMap(RequestViewHTTP.java:304)
	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)



In this case I have 2 redirects (HTTP 302), details are viible for all but last redirects. NullPointerException is whe I click directly on tree result and when I unfold subresults and click on the last one.
Comment 1 Felix Schumacher 2016-06-17 16:28:10 UTC
Could you have a look inside your log files? There should be an exception logged, that your query parameter is not properly encoded.

Nontheless, I think the NPE should be avoided.

This bug is related to https://bz.apache.org/bugzilla/show_bug.cgi?id=59712
as it has the same root cause. The query param decoding seems to be to harsh for the real world.
Comment 2 Felix Schumacher 2016-06-17 16:41:02 UTC
Created attachment 33958 [details]
Use the original query when decoding of it fails

This patch changes the behaviour of the method RequestViewHTTP#decodeQuery from returning 'null' to returning the original query.

I think it is OK, but I am interested, what others think about this.
Comment 3 Pawel 2016-06-21 06:17:43 UTC
(In reply to Felix Schumacher from comment #1)
> Could you have a look inside your log files? There should be an exception
> logged, that your query parameter is not properly encoded.
> 
> Nontheless, I think the NPE should be avoided.
> 
> This bug is related to https://bz.apache.org/bugzilla/show_bug.cgi?id=59712
> as it has the same root cause. The query param decoding seems to be to harsh
> for the real world.

There is nothing more in log file - this stacktrace is from logi file. After clicking in result tree, there is only new stack trace logged.
Comment 4 Felix Schumacher 2016-06-21 18:01:43 UTC

*** This bug has been marked as a duplicate of bug 59712 ***