error with NZ tool with FITS 0.6

56 views
Skip to first unread message

Jim Halliday

unread,
Dec 1, 2011, 2:03:26 PM12/1/11
to fits-...@googlegroups.com

Hi,

 

I am new to using FITS and I am trying to use it within a Java context to generate some file integrity reports. The problem that I am seeing when running FITS is an exception stemming from the New Zealand extraction tool:

 

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:60)

      at edu.harvard.hul.ois.fits.tools.ToolBase.run(ToolBase.java:141)

      at java.lang.Thread.run(Thread.java:662)

Exception in thread "Thread-11" 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:60)

      at edu.harvard.hul.ois.fits.tools.ToolBase.run(ToolBase.java:141)

      at java.lang.Thread.run(Thread.java:662)

 

Despite this problem, the other threads run just fine and an output is generated; I’m just not getting anything from the NZ tool. Am I doing something wrong?

 

Thanks

 

-          Jim Halliday

-          Indiana University

McEwen, Spencer

unread,
Dec 1, 2011, 2:13:28 PM12/1/11
to fits-...@googlegroups.com
Hi Jim,

Is this happening with all files or only those of a particular format?  NLNZ does trap certain errors internally and dumps them to the error output stream, which is usually displayed in your console window.

Even if an individual tool fails or crashes FITS should still finish successfully, which it what sounds like is happening.

Spencer

From: Jim Halliday <mali...@gmail.com>
Reply-To: <fits-...@googlegroups.com>
Date: Thu, 1 Dec 2011 14:03:26 -0500
To: <fits-...@googlegroups.com>
Subject: error with NZ tool with FITS 0.6

Hi,

 

I am new to using FITS and I am trying to use it within a Java context to generate some file integrity reports. The problem that I amseeing when running FITS is an exception stemming from the New Zealand extraction tool:

Jim Halliday

unread,
Dec 1, 2011, 2:30:35 PM12/1/11
to fits-users
The problem is happening with all file types. So far I've tried PDF,
TIFF, and GIF. But yes, everything else does appear to be working just
fine, except for the NZ tool.

- Jim

On Dec 1, 2:13 pm, "McEwen, Spencer" <spencer_mce...@harvard.edu>
wrote:

> read more »...

McEwen, Spencer

unread,
Dec 1, 2011, 3:17:41 PM12/1/11
to fits-...@googlegroups.com
How are you initializing the Fits object? If you use the no arg
constructor:

Fits fits = new Fits();

FITS will look for a FITS_HOME environment variable, If it does not find
it then it will use the current directory as the FITS_HOME.

If you do:

Fits fits = new Fits("fits_home_dir");

The string passed in will be used as your FITS_HOME. FITS_HOME is used to
find the XML and other tool configuration files. This can be handled a
little cleaner and is something I hope can be fixed in a future release.

See line 88 here:
http://code.google.com/p/fits/source/browse/trunk/src/edu/harvard/hul/ois/f
its/Fits.java

Spencer

Jim Halliday

unread,
Dec 1, 2011, 8:32:42 PM12/1/11
to fits-users
I am actually specifying the FITS_HOME variable in the initialization
of the object. Anyway, I noticed something weird. On my Windows
machine, I am getting the error, but in a Unix environment I'm not. I
will eventually be using the Unix environment to do the actual work,
so I guess I am OK. It may be something weird with the way things are
configured on my Windows machine. Anyway, thanks for the help!

- Jim

On Dec 1, 3:17 pm, "McEwen, Spencer" <spencer_mce...@harvard.edu>
wrote:


> How are you initializing the Fits object?  If you use the no arg
> constructor:
>
> Fits fits = new Fits();
>
> FITS will look for a FITS_HOME environment variable,  If it does not find
> it then it will use the current directory as the FITS_HOME.
>
> If you do:
>
> Fits fits = new Fits("fits_home_dir");
>
> The string passed in will be used as your FITS_HOME.  FITS_HOME is used to
> find the XML and other tool configuration files.  This can be handled a
> little cleaner and is something I hope can be fixed in a future release.
>

> See line 88 here:http://code.google.com/p/fits/source/browse/trunk/src/edu/harvard/hul...
> its/Fits.java
>
> Spencer

> >> read more »...- Hide quoted text -
>
> - Show quoted text -

Stefan

unread,
Dec 2, 2011, 5:00:38 AM12/2/11
to fits-users
Hi,

i already had the same problem since fits 0.5.

I have decided to fix the nz tool with the patch that you can find
here:
http://sourceforge.net/tracker/?func=detail&aid=2027729&group_id=189407&atid=929202

You will find the sources of the nz tool here: http://sourceforge.net/projects/meta-extractor/.
After you apply the patch, compile it and bind the jar into fits.

For me it works, I also hope for you.

Very best,
Stefan


On 1 Dez., 20:03, Jim Halliday <malic...@gmail.com> wrote:
> Hi,
>
> I am new to using FITS and I am trying to use it within a Java context to
> generate some file integrity reports. The problem that I am seeing when
> running FITS is an exception stemming from the New Zealand extraction tool:
>

> *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:60*)
>
>       at edu.harvard.hul.ois.fits.tools.ToolBase.run(*ToolBase.java:141*)
>
>       at java.lang.Thread.run(*Thread.java:662*)
>
> Exception in thread "Thread-11" *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:60*)
>
>       at edu.harvard.hul.ois.fits.tools.ToolBase.run(*ToolBase.java:141*)
>
>       at java.lang.Thread.run(*Thread.java:662*)

Stefan

unread,
Aug 2, 2012, 4:39:38 AM8/2/12
to fits-...@googlegroups.com
Hi,

I' ve found out, that copying the config.xml of the nlnz metadata tool into the classes-folder of FITS could help.

Very best,
Stefan
Reply all
Reply to author
Forward
0 new messages