Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled and unclear exception when (included) ruleset is missing #5871

Open
BartChris opened this issue Jan 9, 2024 · 0 comments
Open
Labels
bug ruleset ruleset functions and configuration

Comments

@BartChris
Copy link
Collaborator

BartChris commented Jan 9, 2024

Describe the bug
If you have a ruleset (e.g. ruleset_mono.xml) which includes another ruleset (e.g. ruleset_languages.xml) which is not present Kitodo throws an unhelpful stacktrace.

Given this include statement:

<ruleset xmlns="http:https://names.kitodo.org/ruleset/v2"
    xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http:https://names.kitodo.org/ruleset/v2 ruleset.xsd" lang="en">
    <include>ruleset_languages.xml</include>
...

if ruleset_languages.xml does not exist the following stacktrace is shown in the UI:

image

The same stracktrace is shown if the original ruleset ruleset_mono.xmlis missing, so there is also no useful error in the UI for that scenario.

In the Kitodo logfile a more helpful error message is displayed:

[ERROR] 2024-01-09 18:45:25.349 [http-nio-8080-exec-6] CreateProcessForm - Die angegebene Regelsatzdatei ruleset_mono.xml konnte nicht gefunden werden.
org.kitodo.exceptions.RulesetNotFoundException: Die angegebene Regelsatzdatei ruleset_mono.xml konnte nicht gefunden werden.
	at org.kitodo.production.services.data.RulesetService.openRuleset(RulesetService.java:239) ~[classes/:3.7.0-SNAPSHOT]
	at org.kitodo.production.forms.createprocess.CreateProcessForm.updateRulesetAndDocType(CreateProcessForm.java:130) ~[classes/:3.7.0-SNAPSHOT]
	at org.kitodo.production.forms.createprocess.CreateProcessForm.prepareProcess(CreateProcessForm.java:431) ~[classes/:3.7.0-SNAPSHOT]

But this is also not the reason for the error message since ruleset_mono.xml is present. What is missing is ruleset_languages.xml but the error log does not indicate that.

To Reproduce
Steps to reproduce the behavior:

  1. Create a ruleset which includes another ruleset which is not present in the file system.
  2. Try to create a process with a process template using that ruleset.

Expected behavior
It should be reported (at best in the UI) that the included ruleset file is not present.

Release
Current Master (3.6.1 as well)

@BartChris BartChris added the bug label Jan 9, 2024
@BartChris BartChris changed the title Unhandled and unclear exception when included ruleset is missing Unhandled and unclear exception when (included) ruleset is missing Jan 9, 2024
@solth solth added the ruleset ruleset functions and configuration label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ruleset ruleset functions and configuration
Projects
None yet
Development

No branches or pull requests

2 participants