invesdwin / invesdwin-context-client

invesdwin-context modules that provide frontend functionality for the desktop and web
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Chart: ArrayIndexOutOfBounds with markers and crosshair #6

Closed subes closed 3 years ago

subes commented 3 years ago

Maybe more synchronization is needed on the markers list. The internal size seems to have been corrupted and became -1.

de.invesdwin.context.log.error.LoggedRuntimeException: #00000167 java.lang.Exception: Ignoring
        ... 35 omitted, see following cause or error.log
Caused by - java.lang.Exception: Ignoring
      * at de.invesdwin.context.client.swing.jfreechart.panel.InteractiveChartPanel$MouseMotionListenerImpl.mouseMoved(InteractiveChartPanel.java:610) *
        ... 31 more, see error.log
Caused by - java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
        at java.base/java.util.ArrayList.add(ArrayList.java:454)
        at java.base/java.util.ArrayList.add(ArrayList.java:466)
        at org.jfree.chart.plot.XYPlot.addDomainMarker(XYPlot.java:2525)
        at org.jfree.chart.plot.XYPlot.addDomainMarker(XYPlot.java:2495)
        at org.jfree.chart.plot.XYPlot.addDomainMarker(XYPlot.java:2415)
        at org.jfree.chart.plot.XYPlot.addDomainMarker(XYPlot.java:2399)
      * at de.invesdwin.context.client.swing.jfreechart.panel.helper.PlotCrosshairHelper.updateCrosshair(PlotCrosshairHelper.java:123) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.helper.PlotCrosshairHelper.mouseMoved(PlotCrosshairHelper.java:219) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.InteractiveChartPanel$MouseMotionListenerImpl.mouseMoved(InteractiveChartPanel.java:604) *
        ... 31 more, see error.log
subes commented 3 years ago

Happened during debugging inside an update method of a lazy slave dataset for a series.

subes commented 3 years ago

Another exception:

2021-01-22 09:35:46.858 [ |AWT-EventQueue-0   ] ERROR de.invesdwin.ERROR.process                                   - processing #00000295
de.invesdwin.context.log.error.LoggedRuntimeException: #00000295 java.lang.RuntimeException: Must be some race condition, retrying
        ... 84 omitted, see following cause or error.log
Caused by - java.lang.RuntimeException: Must be some race condition, retrying
      * at de.invesdwin.context.client.swing.jfreechart.panel.basis.CustomChartPanel.paintComponent(CustomChartPanel.java:757) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.InteractiveChartPanel$1.paintComponent(InteractiveChartPanel.java:148) *
        ... 79 more, see error.log
Caused by - java.util.NoSuchElementException: null
        at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1000)
        at java.base/java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1047)
        at org.jfree.chart.plot.XYPlot.drawDomainMarkers(XYPlot.java:4000)
        at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3334)
        at org.jfree.chart.plot.CombinedDomainXYPlot.draw(CombinedDomainXYPlot.java:506)
        at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1286)
      * at de.invesdwin.context.client.swing.jfreechart.panel.basis.CustomChartPanel.paintComponent(CustomChartPanel.java:730) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.InteractiveChartPanel$1.paintComponent(InteractiveChartPanel.java:148) *
        ... 79 more, see error.log
2021-01-22 09:35:46.889 [ |AWT-EventQueue-0   ] ERROR de.invesdwin.ERROR.process                                   - processing #00000296
de.invesdwin.context.log.error.LoggedRuntimeException: #00000296 java.lang.RuntimeException: Must be some race condition, retrying
        ... 86 omitted, see following cause or error.log
Caused by - java.lang.RuntimeException: Must be some race condition, retrying
      * at de.invesdwin.context.client.swing.jfreechart.panel.basis.CustomChartPanel.paintComponent(CustomChartPanel.java:757) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.InteractiveChartPanel$1.paintComponent(InteractiveChartPanel.java:148) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.basis.CustomChartPanel.paintComponent(CustomChartPanel.java:758) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.InteractiveChartPanel$1.paintComponent(InteractiveChartPanel.java:148) *
        ... 79 more, see error.log
Caused by - java.util.NoSuchElementException: null
        at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1000)
        at java.base/java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1047)
        at org.jfree.chart.plot.XYPlot.drawDomainMarkers(XYPlot.java:4000)
        at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3334)
        at org.jfree.chart.plot.CombinedDomainXYPlot.draw(CombinedDomainXYPlot.java:506)
        at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1286)
      * at de.invesdwin.context.client.swing.jfreechart.panel.basis.CustomChartPanel.paintComponent(CustomChartPanel.java:730) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.InteractiveChartPanel$1.paintComponent(InteractiveChartPanel.java:148) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.basis.CustomChartPanel.paintComponent(CustomChartPanel.java:758) *
      * at de.invesdwin.context.client.swing.jfreechart.panel.InteractiveChartPanel$1.paintComponent(InteractiveChartPanel.java:148) *
        ... 79 more, see error.log
subes commented 3 years ago

Should be fixed now. Crosshair updates needed to be run in EDT on dataset change events.