Error Java null key argument

Hello.

We have the next error on Report viewer

12:14:53.320 [AWT-EventQueue-0] WARN reporting.Preview - Error generating preview
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Null ‘key’ argument.
at java.base/java.util.concurrent.FutureTask.report(Unknown Source)
at java.base/java.util.concurrent.FutureTask.get(Unknown Source)
at java.desktop/javax.swing.SwingWorker.get(Unknown Source)
at com.inductiveautomation.reporting.designer.workspace.design.PreviewPanel$PreviewGenerator.done(PreviewPanel.java:109)
at java.desktop/javax.swing.SwingWorker$5.run(Unknown Source)
at java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
at java.desktop/sun.swing.AccumulativeRunnable.run(Unknown Source)
at java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at java.desktop/javax.swing.Timer.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at com.inductiveautomation.snap.swing.RibsEventQueue.dispatchEvent(RibsEventQueue.java:99)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Null ‘key’ argument.
at org.jfree.data.DefaultKeyedValues.setValue(DefaultKeyedValues.java:229)
at org.jfree.data.DefaultKeyedValues2D.setValue(DefaultKeyedValues2D.java:337)
at org.jfree.data.DefaultKeyedValues2D.addValue(DefaultKeyedValues2D.java:303)
at org.jfree.data.category.DefaultCategoryDataset.addValue(DefaultCategoryDataset.java:222)
at org.jfree.data.category.DefaultCategoryDataset.addValue(DefaultCategoryDataset.java:237)
at com.inductiveautomation.rm.shape.j2dshapes.CategoryChart.rpgShape(CategoryChart.java:159)
at com.inductiveautomation.rm.shape.RMShape.rpgAll(RMShape.java:2842)
at com.inductiveautomation.rm.shape.ReportOwner.rpg(ReportOwner.java:178)
at com.inductiveautomation.rm.shape.RMParentShape.rpgChildren(RMParentShape.java:597)
at com.inductiveautomation.rm.shape.RMPage.rpgChildren(RMPage.java:696)
at com.inductiveautomation.rm.shape.RMParentShape.rpgAll(RMParentShape.java:584)
at com.inductiveautomation.rm.shape.RMPage.rpgAll(RMPage.java:659)
at com.inductiveautomation.rm.shape.ReportOwner.rpg(ReportOwner.java:178)
at com.inductiveautomation.rm.shape.RMDocument.rpgChildren(RMDocument.java:1089)
at com.inductiveautomation.rm.shape.RMParentShape.rpgAll(RMParentShape.java:584)
at com.inductiveautomation.rm.shape.ReportOwner.rpg(ReportOwner.java:178)
at com.inductiveautomation.rm.shape.ReportOwner.generateReport(ReportOwner.java:169)
at com.inductiveautomation.rm.shape.RMDocument.generateReport(RMDocument.java:1065)
at com.inductiveautomation.rm.shape.RMDocument.generateReport(RMDocument.java:1033)
at com.inductiveautomation.reporting.designer.workspace.design.PreviewPanel$PreviewGenerator.doInBackground(PreviewPanel.java:102)
at com.inductiveautomation.reporting.designer.workspace.design.PreviewPanel$PreviewGenerator.doInBackground(PreviewPanel.java:84)
at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.desktop/javax.swing.SwingWorker.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

Could you help us?

Thank you.
Best regards.

1 Like

I don’t know anything much about reports but it looks like it’s expecting a dictionary with "key": "value" and that it’s not getting one. What parameters are you passing to the viewer?

Specifically, you've got a null value where it's not expected on a category chart.