Sometimes get massive runtime error

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
mcgeochd
Posts: 6
Joined: Thu Jul 19, 2018 10:38 pm
antibot: No, of course not.

Sometimes get massive runtime error

Post by mcgeochd » Sun Jul 22, 2018 4:08 pm

Hi,

I'm running with JFreeChart 1.5 on Intellij 2018.1.6 generating an XYLineChart from fewer than ~200 data points with a range roughly between 0 - 100,000 and sometimes I get this error at runtime and the chart doesn't generate:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.text.DecimalFormat.fastDoubleFormat(DecimalFormat.java:1458)
at java.text.DecimalFormat.fastFormat(DecimalFormat.java:1584)
at java.text.NumberFormat.format(NumberFormat.java:292)
at org.jfree.chart.axis.NumberTickUnit.valueToString(NumberTickUnit.java:116)
at org.jfree.chart.axis.NumberAxis.estimateMaximumTickLabelWidth(NumberAxis.java:798)
at org.jfree.chart.axis.NumberAxis.selectHorizontalAutoTickUnit(NumberAxis.java:852)
at org.jfree.chart.axis.NumberAxis.selectAutoTickUnit(NumberAxis.java:823)
at org.jfree.chart.axis.NumberAxis.refreshTicksHorizontal(NumberAxis.java:952)
at org.jfree.chart.axis.NumberAxis.refreshTicks(NumberAxis.java:924)
at org.jfree.chart.axis.ValueAxis.reserveSpace(ValueAxis.java:797)
at org.jfree.chart.plot.XYPlot.calculateDomainAxisSpace(XYPlot.java:2997)
at org.jfree.chart.plot.XYPlot.calculateAxisSpace(XYPlot.java:2956)
at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3098)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1142)
at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1349)
at javax.swing.JComponent.paint(JComponent.java:1056)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Can't really ascertain the problem as it doesn't always occur so it must be something to do with the data values?
Any help appreciated.

EDIT: Another common runtime error i get is:

java.lang.IllegalStateException: We should never get here.
at org.jfree.chart.axis.NumberTickUnitSource.next(NumberTickUnitSource.java:153)
at org.jfree.chart.axis.NumberTickUnitSource.getCeilingTickUnit(NumberTickUnitSource.java:128)
at org.jfree.chart.axis.NumberAxis.selectVerticalAutoTickUnit(NumberAxis.java:894)
at org.jfree.chart.axis.NumberAxis.selectAutoTickUnit(NumberAxis.java:826)
at org.jfree.chart.axis.NumberAxis.refreshTicksVertical(NumberAxis.java:1047)
at org.jfree.chart.axis.NumberAxis.refreshTicks(NumberAxis.java:927)
at org.jfree.chart.axis.ValueAxis.reserveSpace(ValueAxis.java:797)
at org.jfree.chart.plot.XYPlot.calculateRangeAxisSpace(XYPlot.java:3043)
at org.jfree.chart.plot.XYPlot.calculateAxisSpace(XYPlot.java:2954)
at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3098)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1142)
at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1349)
at main.Visualiser.draw(Visualiser.java:44)
at main.Visualiser.visualiseSettlement(Visualiser.java:38)
at main.MainClass.main(MainClass.java:43)

Post Reply