“NullPointerException”: null during running 'Strings to Document' node

Hi

I was running the “NullPointerException”: null while executing the ‘Strings to Document’ node. I went through a discussion that has already taken place in the forum- Strings To Document - NullPointerException - #11 by natanaeldgsantos

But I could not find a satisfactory solution there. I have the updated version of KNIME (version 4.5.2) and there are no more updates. Interestingly one of my friends who has worked on the same dataset on the same version of KNIME is not facing any such issues.

Please guide me if there is any other way I can fix the error.

Error Log:
eclipse.buildId=unknown
java.version=11.0.10
java.vendor=AdoptOpenJDK
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64

org.eclipse.ui
Error
Mon May 23 06:38:41 EDT 2022
Unhandled event loop exception

java.lang.NullPointerException
at org.knime.workbench.explorer.view.actions.export.WorkflowExportWizard.addPages(WorkflowExportWizard.java:116)
at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:632)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
at org.knime.workbench.explorer.view.actions.export.WorkflowExportHelper.openExportWizard(WorkflowExportHelper.java:84)
at org.knime.workbench.explorer.view.actions.export.WorkflowExportApplicationAction.run(WorkflowExportApplicationAction.java:103)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1043)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4026)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3626)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.knime.product.rcp.KNIMEApplication.start(KNIMEApplication.java:183)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1461)

KNIME_project_5_workflow (1).knwf (9.1 KB)

Hi @ayandutta , have you tried choosing Empty String under the ‘title’ section?

Can you upload your CSV file as well, so we can try to reproduce the problem? (Assuming it doesn’t have confidential information included?)

Hi Scott,

Please find the dataset attached here. The files in .csv format were not showing up while uploading so I have converted it to .xlsx format and then uploaded it.

US-Economic-News.xlsx (667.0 KB)

Hi Badger,

Yes, I have kept it empty, attaching the configuration window settings of the node here.

Hi @ayandutta I tried doing it with Excel Reader node followed by Strings to Doc. And I got no errors. You might wanna try this rather than the CSV reader.

Maybe it has something to do with the fact that the text column contains <br> tags that disallow the conversion from csv-based strings to docs to be done properly. A similar but non-identical issue can be found in this post:

2 Likes

I think @badger101 is on to something here. I wasn’t able to recreate your problem with the Excel data provided, and even when I converted it back to CSV the CSV Reader performed OK. So I think there might be something strange about the encoding of your CSV file that the import to Excel magically took care of somehow.

That said, you probably want to clean up the line break tags with a String Manipulation node prior to converting the text to documents.

Also, I think reading in the headline as the Title is a good idea in this case, since it contains relevant information. The Strings to Document node will parse both the title and text by default.

2 Likes

Thank you, @badger101 I will try it out.

Thank you, @ScottF I will try it out.

Hi @badger101 and @ScottF

I tried using the excel data and even tried with the clean data (without HTML tags) but I am still getting an error for the ‘Strings to Document’ node. I am sharing the error below.

Additionally, I don’t think my error log module is working correctly. For some reason, I can only view the error log only up to the 25th of May. I am attaching a screenshot of this. Please help!

ERROR Extended NER Preprocessing 2:12       Unable to load node with ID suffix 8 into workflow, skipping it: null
ERROR Extended NER Preprocessing 2:12       Unable to load node with ID suffix 9 into workflow, skipping it: Could not initialize class org.knime.ext.textprocessing.nodes.tagging.opennlpner.OpennlpNerTaggerNodeModel2
ERROR Extended NER Preprocessing 2:12       Unable to load node with ID suffix 10 into workflow, skipping it: Could not initialize class org.knime.ext.textprocessing.nodes.tagging.opennlpner.OpennlpNerTaggerNodeModel2
WARN  Strings To Document  4:19       Name of selected title column can't be empty.
ERROR Strings To Document  4:19       Execute failed: ("NullPointerException"): null
WARN  Excel Reader         4:20       Please specify a file
WARN  Excel Reader         4:20       The node configuration changed and the table spec will be recalculated during execution.
ERROR Strings To Document  4:19       Execute failed: ("NullPointerException"): null
WARN  Excel Reader         5:27       The node configuration changed and the table spec will be recalculated during execution.
ERROR Strings To Document  5:28       Execute failed: ("NullPointerException"): null
ERROR Strings To Document  4:19       Execute failed: ("NullPointerException"): null
ERROR Strings To Document  5:28       Execute failed: ("NullPointerException"): null 

Hi @ayandutta , can you attach the workflow as well? (Note: When exporting, untick the box saying reset. )

I will second @badger101 `s request. We really need you to upload a workflow if possible, so that we can see the exact node configuration leading to the NPE.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.