Opened 16 years ago
Closed 16 years ago
#1157 closed defect (fixed)
Annotation importer fails with NullPointerException in end()
Reported by: | Jari Häkkinen | Owned by: | Nicklas Nordborg |
---|---|---|---|
Priority: | major | Milestone: | BASE 2.8.4 |
Component: | coreplugins | Version: | 2.8.3 |
Keywords: | Cc: |
Description
The number of columns is correct. After adding the new line in the last line the annotaions are imported.
Tested on our facility server running BASE 2.8.3
Change History (7)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
comment:3 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
After getting more details about this I realize that there was a 'Data footer' parameter given to the plug-in but the file did not have a data footer! So of course the plug-in complains it cannot find a footer!
Case closed.
The output from the failed job is
java.lang.NullPointerException at net.sf.basedb.plugins.AnnotationFlatFileImporter.end(AnnotationFlatFileImporter.java:872) at net.sf.basedb.plugins.AbstractFlatFileImporter.doImport(AbstractFlatFileImporter.java:653) at net.sf.basedb.plugins.AbstractFlatFileImporter.run(AbstractFlatFileImporter.java:443) at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:108) at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:506) at java.lang.Thread.run(Thread.java:619)
comment:4 by , 16 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Summary: | Annotation importer fails when last line in file has data but no new line character → Annotation importer fails with NullPointerException |
Hmmm... I can't see how a missing Data footer in the file can lead to this error. A NullPointerException is usually a sign of some kind of bug. It should at least be replaced with a better error message.
I check the code it seems like this error can only happens if the start of the data could not be found. But that usually results in an error message saying something like: The file .... can't be imported by this plug-in. So, it seems like there is a loophole where the plug-in thinks it has found some data but when the import starts there is actually no data and the end() method is called but beginData() was never been called. In this case it may be that the NullPointerException is actually masking the real error message.
It would be useful with some more information, for example the plug-in configuration that results in the NullPointerException (can be exported as an XML file) and an example file to use it with.
comment:5 by , 16 years ago
Milestone: | → BASE 2.8.4 |
---|---|
Owner: | changed from | to
Status: | reopened → new |
Summary: | Annotation importer fails with NullPointerException → Annotation importer fails with NullPointerException in end() |
I think the NullPointerException is just masking the real error message. One way to reproduce the problem is to enter a column mapping for the 'Name' property that doesn't exist in the file. This is not detected in the configuration phase and results in the NullPointerException. If the end() method is fixed an understandable error message is displayed: Column 'foo' not found in column headers.
comment:6 by , 16 years ago
Status: | new → assigned |
---|
comment:7 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [4601]) Fixes #1157: Annotation importer fails with NullPointerException in end()
Works on the test code even if I remove the last empty line from the test file. So, what is happening when it doesn't work? Error message and other information would be useful.