jhove
jhove copied to clipboard
Java exception under Windows; seems to be config related
Dev Effort
0.5D
Description
After installing JHOVE on Windows and configuring it as described in the readme, execution results in:
Exception in thread "main" java.lang.NoClassDefFoundError: edu/harvard/hul/ois/j
hove/viewer/ConfigWindow
at edu.harvard.hul.ois.jhove.DefaultConfigurationBuilder.writeDefaultCon
figFile(Unknown Source)
at edu.harvard.hul.ois.jhove.JhoveBase.init(Unknown Source)
at Jhove.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: edu.harvard.hul.ois.jhove.viewer.Co
nfigWindow
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
This happens under Windows 7; java version is 1.8.0_51. Going back through my files I see this is the same error I got almost 2 years ago:
http://openpreservation.org/blog/2014/01/31/why-cant-we-have-digital-preservation-tools-just-work/
And I remember this started happening after some changes to the way JHOVE looks for its configuration, which was prompted by this long-running issue:
http://sourceforge.net/p/jhove/bugs/53/
If I explicitly specify the location of the config file with the c
switch, e.g.:
jhove -c C:\jhove\conf\jhove.conf
In this case JHOVE does run normally.
There are a few things I'm not mad keen on around configuration:
- the lack of a sensible, working default, preferably derived/ non-serialised / packaged as a resource;
- the fact that the responsibility for config isn't clearly defined, it's used to set a particular state for the engine, but the engine has mutators that mean that this state isn't definitive;
- the presence of temp directory that defaults to
.
if not specified in config as this is the default set in JhoveBase; and - the overriding of config via settings files and params, and the roles of JhoveBase.getConfigFileFromProperties(), JhoveBase.getSaxClassFromProperties, and JhoveBase.getFromProperties(String name) are a little intertwined and undocumented.
I have some thoughts as to how to clean the config up a little but would rather express them in code first I think.