Opened 13 years ago
Closed 13 years ago
#1632 closed defect (fixed)
NullPointerException when using JEP mapping for column with string values
Reported by: | Nicklas Nordborg | Owned by: | everyone |
---|---|---|---|
Priority: | minor | Milestone: | BASE 3.0 |
Component: | coreplugins | Version: | |
Keywords: | Cc: |
Description
This can for example be tested by using the reporter importer with a GenePix file. Change the reporter id mapping from \ID\ to =col('ID').
The parser return a null value instead of the value in the column. The error message is:
net.sf.basedb.core.BaseException: Invalid use of null. The 'externalId' value cannot be set to null. on line 33 in file 'genepix.mouse.v4.37k.00h.gpr': 1 1 1 "NULL" "M40... at net.sf.basedb.plugins.AbstractFlatFileImporter.doImport(AbstractFlatFileImporter.java:708) at net.sf.basedb.plugins.AbstractFlatFileImporter.run(AbstractFlatFileImporter.java:445) at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:116) at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:510) at java.lang.Thread.run(Unknown Source) Caused by: net.sf.basedb.core.InvalidUseOfNullException: Invalid use of null. The 'externalId' value cannot be set to null. at net.sf.basedb.plugins.ReporterFlatFileImporter.handleData(ReporterFlatFileImporter.java:561) at net.sf.basedb.plugins.AbstractFlatFileImporter.doImport(AbstractFlatFileImporter.java:676) ... 4 more
After investigation it seems like the problem is a NullPointerException in the ColFunction
that is happening for non-numerical values. The exception is swallowed by the JEP parser and null is returned.
Note:
See TracTickets
for help on using tickets.
(In [5769]) Fixes #1632: NullPointerException when using JEP mapping for column with string values
The reason for the NullPointerException was that we tried to convert the string to a double. This is now fixed and I have also changed JEP to pass on exceptions instead of swallowing them. I hope that doesn't cause problems elsewhere.