kitodo / kitodo-production

Kitodo.Production is a workflow management tool for mass digitization and is part of the Kitodo Digital Library Suite.
http://www.kitodo.org/software/kitodoproduction/
GNU General Public License v3.0
62 stars 63 forks source link

Stack trace if ruleset cannot be loaded #6165

Closed matthias-ronge closed 1 week ago

matthias-ronge commented 1 month ago

If the ruleset cannot be loaded (i.e. if there is a typo in the XML, and it is syntactically invalid) a stack trace is shown, that also hides the error message.

Stack trace:

java.lang.NullPointerException
    at org.kitodo.production.forms.createprocess.AddMetadataDialog.prepareAddableMetadataForStructure(AddMetadataDialog.java:78)
    at org.kitodo.production.forms.createprocess.AddMetadataDialog.metadataAddableToStructureElement(AddMetadataDialog.java:67)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ...
solth commented 1 month ago

@matthias-ronge please use the issue template and specify how to reproduce this error. Does it occur when opening a process in the metadata editor?

Edit: ok, you already provided a fix for this issue. So don't mind about my comment above ;)

matthias-ronge commented 1 month ago

I.e., have a typo like this in your ruleset:

<labe>Title</label>
henning-gerhardt commented 1 month ago

As a side note which can be moved into an own issue: we should think about in a long term thinking if it would not better to use at least a basic XML validation on accessing any XML file (meta data file, ruleset files, xslt files, ...) and report any issue found there before any future program code is using an invalid XML file?