Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Exception java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 in thread Thread[AWT-EventQueue-0,6,main]. #5807

Closed
milamberspace opened this issue Apr 19, 2023 · 1 comment
Assignees
Labels

Comments

@milamberspace
Copy link
Contributor

Expected behavior

JMeter parse correctly the parameters on URI

Actual behavior

JMeter generates this error when a parameter has no key and no value i.e.: param=1&=&param=2

2023-04-19 11:57:50,083 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.getQueryMap(RequestViewHTTP.java:290) ~[ApacheJMeter_http.jar:5.4.3]
at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.setSamplerResult(RequestViewHTTP.java:216) ~[ApacheJMeter_http.jar:5.4.3]
at org.apache.jmeter.visualizers.RequestPanel.setSamplerResult(RequestPanel.java:116) ~[ApacheJMeter_components.jar:5.4.3]
at org.apache.jmeter.visualizers.SamplerResultTab.setupTabPane(SamplerResultTab.java:238) ~[ApacheJMeter_components.jar:5.4.3]
at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.valueChanged(ViewResultsFullVisualizer.java:385) ~[ApacheJMeter_components.jar:5.4.3]
at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.valueChanged(ViewResultsFullVisualizer.java:363) ~[ApacheJMeter_components.jar:5.4.3]
at javax.swing.JTree.fireValueChanged(JTree.java:3019) ~[?:?]
at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3520) ~[?:?]
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:650) ~[?:?]
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1120) ~[?:?]
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:306) ~[?:?]
at javax.swing.JTree.setSelectionInterval(JTree.java:2636) ~[?:?]
at javax.swing.plaf.basic.BasicTreeUI$Actions.increment(BasicTreeUI.java:4850) ~[?:?]
at javax.swing.plaf.basic.BasicTreeUI$Actions.actionPerformed(BasicTreeUI.java:4531) ~[?:?]
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810) ~[?:?]
at javax.swing.JComponent.processKeyBinding(JComponent.java:2947) ~[?:?]
at javax.swing.JComponent.processKeyBindings(JComponent.java:2995) ~[?:?]
at javax.swing.JComponent.processKeyEvent(JComponent.java:2909) ~[?:?]
at java.awt.Component.processEvent(Component.java:6403) ~[?:?]
at java.awt.Container.processEvent(Container.java:2266) ~[?:?]
at java.awt.Component.dispatchEventImpl(Component.java:5001) ~[?:?]
at java.awt.Container.dispatchEventImpl(Container.java:2324) ~[?:?]
at java.awt.Component.dispatchEvent(Component.java:4833) ~[?:?]
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1952) ~[?:?]
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:883) ~[?:?]
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1150) ~[?:?]
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1020) ~[?:?]
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:848) ~[?:?]
at java.awt.Component.dispatchEventImpl(Component.java:4882) ~[?:?]
at java.awt.Container.dispatchEventImpl(Container.java:2324) ~[?:?]
at java.awt.Window.dispatchEventImpl(Window.java:2780) ~[?:?]
at java.awt.Component.dispatchEvent(Component.java:4833) ~[?:?]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) ~[?:?]
at java.awt.EventQueue$4.run(EventQueue.java:722) ~[?:?]
at java.awt.EventQueue$4.run(EventQueue.java:716) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) ~[?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) ~[?:?]
at java.awt.EventQueue$5.run(EventQueue.java:746) ~[?:?]
at java.awt.EventQueue$5.run(EventQueue.java:744) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) ~[?:?]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:743) ~[?:?]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?]

Steps to reproduce the problem

Try to display in View Result Tree a request with this URL

GET https://www.domain.com/api/operation/operation-with-period/search?page=0&size=10&sort=fosId,asc&=&typeOperation=INITIAL

The issue is : ,asc&=&type

In the code the issue is :

    for (String param : params) {
        String[] paramSplit = param.split("=");
        String name = decodeQuery(paramSplit[0]);

Missing a test tif paramSplit[0] have a size of 0

JMeter Version

5.5

Java Version

java8

OS Version

Linux/Windows

@milamberspace
Copy link
Contributor Author

JMX file to test the issue

@milamberspace milamberspace self-assigned this Apr 20, 2023
milamberspace added a commit to milamberspace/jmeter that referenced this issue Apr 20, 2023
…eters line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2"
milamberspace added a commit to milamberspace/jmeter that referenced this issue Apr 20, 2023
…eters line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2"
milamberspace added a commit to milamberspace/jmeter that referenced this issue Apr 22, 2023
…eters line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2
milamberspace added a commit to milamberspace/jmeter that referenced this issue Apr 22, 2023
milamberspace added a commit to milamberspace/jmeter that referenced this issue Apr 22, 2023
…eters line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2
milamberspace added a commit to milamberspace/jmeter that referenced this issue Apr 23, 2023
…eters line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2
milamberspace added a commit to milamberspace/jmeter that referenced this issue Apr 23, 2023
…eters line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2

Thanks to Felix for code improvement
milamberspace added a commit to milamberspace/jmeter that referenced this issue Apr 23, 2023
…eters line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2

Thanks to Felix for code improvement
milamberspace added a commit that referenced this issue Apr 23, 2023
…line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2 (#5812)

Thanks to Felix for code improvement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant