NullPointerExceptions by NLNZ Metadata Extractor

29 views
Skip to first unread message

henk van den berg

unread,
Jun 1, 2015, 9:32:20 AM6/1/15
to fits-...@googlegroups.com
When using the Java API of the Fits distribution 0.8.5, the NLNZ Metadata Extractor keeps throwing NullPointerExceptions:

java.lang.NullPointerException
    at nz.govt.natlib.meta.config.Config.readConfig(Config.java:563)
    at nz.govt.natlib.meta.config.Config.<init>(Config.java:198)
    at nz.govt.natlib.meta.config.Config.getInstance(Config.java:263)
    at edu.harvard.hul.ois.fits.tools.nlnz.MetadataExtractor.extractInfo(MetadataExtractor.java:71)
    at edu.harvard.hul.ois.fits.tools.ToolBase.run(ToolBase.java:275)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "NLNZ Metadata Extractor" java.lang.NullPointerException
    at nz.govt.natlib.meta.config.Config.setXMLBaseURL(Config.java:375)
    at edu.harvard.hul.ois.fits.tools.nlnz.MetadataExtractor.extractInfo(MetadataExtractor.java:71)
    at edu.harvard.hul.ois.fits.tools.ToolBase.run(ToolBase.java:275)
    at java.lang.Thread.run(Thread.java:745)

In fact what readConfig in the nz.govt.natlib.meta.config.Config class tries to do is to close an Inputstream that never was initialized. Their fault obviously, but I suspect it is preventing the NLNZ Metadata Extractor tool to become active.

If you put a copy of config.xml on your classpath this annoying error goes away. You can find config.xml on the SourceForge site of NLNZ Metadata Extractor at http://meta-extractor.cvs.sourceforge.net/viewvc/meta-extractor/metadata-extractor/src/xml/config.xml?revision=1.7&content-type=text%2Fplain

Notice that in config.xml you will have to comment out any adapters that are not in your Fits distribution at directory fits-0.8.5/lib/nzmetool/adapters.

After this Fits runs smoothly without throwing exceptions.
Reply all
Reply to author
Forward
0 new messages