Report Null pointer exception

Hi,

I am playing around with reports and get the following error message by simply clicking on the "Data to Report" node in the KNIME view...

any idea why this would be happing?

I was adding/removing workflow variables and tried to bind a table to a Text box…


3004: Unexpected error occurred.
  java.lang.NullPointerException
  	at org.knime.workbench.editor2.editparts.NodeContainerProperties.getPropertyValue(NodeContainerProperties.java:200)
  	at org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:611)
  	at org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:568)
  	at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:760)
  	at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:973)
  	at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:510)
  	at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:363)
  	at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(AbstractSelectionService.java:179)
  	at org.eclipse.ui.internal.AbstractSelectionService$2.selectionChanged(AbstractSelectionService.java:71)
  	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.fireSelectionChanged(AbstractEditPartViewer.java:247)
  	at org.eclipse.gef.ui.parts.AbstractEditPartViewer$1.run(AbstractEditPartViewer.java:131)
  	at org.eclipse.gef.SelectionManager.fireSelectionChanged(SelectionManager.java:144)
  	at org.eclipse.gef.SelectionManager.appendSelection(SelectionManager.java:83)
  	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.appendSelection(AbstractEditPartViewer.java:190)
  	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.select(AbstractEditPartViewer.java:599)
  	at org.eclipse.gef.tools.SelectEditPartTracker.performSelection(SelectEditPartTracker.java:221)
  	at org.eclipse.gef.tools.SelectEditPartTracker.performConditionalSelection(SelectEditPartTracker.java:167)
  	at org.eclipse.gef.tools.SelectEditPartTracker.handleButtonDown(SelectEditPartTracker.java:92)
  	at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.java:1091)
  	at org.eclipse.gef.tools.SelectionTool.mouseDown(SelectionTool.java:514)
  	at org.knime.workbench.editor2.WorkflowSelectionTool.mouseDown(WorkflowSelectionTool.java:83)
  	at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:245)
  	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMousePressed(DomainEventDispatcher.java:348)
  	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown(LightweightSystem.java:523)
  	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:191)
  	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
  	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
  	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
  	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
  	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
  	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
  	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
  	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
  	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
  	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
  	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
  	at org.knime.product.rcp.KNIMEApplication.start(KNIMEApplication.java:128)
  	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
  	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
  	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  	at java.lang.reflect.Method.invoke(Method.java:601)
  	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
  	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
  	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
  	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

Actually this doesn't only happen with the Data to Report node basically with all nodes...

 

B

It looks like a bug in the node properties view.  If you close this, the problem should go away.  This issue has been fixed for version 2.9.

Regards,

Aaron

As you should know, Java types are divided into primitive types (boolean, int, etc.) and reference types. Reference types in Java allow you to use the special value null which is the Java way of saying “no object”.

A NullPointerException is thrown at runtime whenever your program attempts to use a null as if it was a real reference. For example, if you write this:

public class Test {
    public static void main(String[] args) {
        String foo = null;
        int length = foo.length();   // NullPointerException
    }
}

NullPointerExceptions are exceptions that occur when you try to use a reference that points to no location in memory (null) as though it were referencing an object. Calling a method on a null reference or trying to access a field of a null reference will trigger a NullPointerException.

How do I fix it?

Identifying exactly which values are causing the exception. For this, we need to do some debugging. It’s important to learn to read a stacktrace. This will show you where the exception was thrown. In order to fix this NullPointerException you should always initialize your objects before you try to do anything with them.

You can avoid this NullPointerException by coding like this:

  if(str != null){
    //do something
  } else {
    //do something
  }