Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#65495 - [pdftk] Missing Dependency java-commons-lang leads Strange GSCAN2PDFWarnings

Attached to Project: Community Packages
Opened by Thomas Reim (rdratlos) - Friday, 14 February 2020, 10:35 GMT
Last edited by Jonas Witschel (diabonas) - Friday, 14 February 2020, 11:55 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jonas Witschel (diabonas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No



If optional dependency pdftk is installed and used for package gscan2pdf and package java-commons-lang, which is an optional dependency for pdftk itself, is not installed, gscan2pdf throws strange warnings at startup:
1. message:
"pdftk is installed, but cannot access the directory used for temporary files.One reason for this might be that pdftk was installed via snap.In this case, removing pdftk, and reinstalling without using snap would allow gscan2pdf to use pdftk. Another workaround would be to select a temporary directory under your home directory in Edit/Preferences."
2. message
Warning: missing packages
PDF encryption requires pdftk."

Analysis shows that the warnings are caused by gscan2pdf executing pdftk's dump_data function. As soon as package java-commons-lang has been installed, the warning messages are not shown aghain and gscan2pdf works fine.

Please check, if java-commons-lang should be a mandatory dependency.

Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
Uninstall package java-commons-lang (if installed)
Install and start gscan2pdf
Start gscan2pdf -> Check warning messages

Then install java-commons-lang
Start gscan2pdf again -> No warnings

This task depends upon

Closed by  Jonas Witschel (diabonas)
Friday, 14 February 2020, 11:55 GMT
Reason for closing:  Duplicate
Additional comments about closing:  FS#65496
Comment by Thomas Reim (rdratlos) - Friday, 14 February 2020, 10:54 GMT
Further analysis shows that gscan2pdf now requires package pdftk as dependency. If pdftk is not installed a warning message is shown: "Missing package: PDF encryption requires pdftk"
Comment by Jonas Witschel (diabonas) - Friday, 14 February 2020, 11:55 GMT
java-commons-lang is really just an optional dependency for pdftk since it is only needed for the operations specified in the description of the optional dependency (dump_data, dump_data_fields and update_info), see and  FS#64159 ,  FS#64575 . If java-commons-lang is not installed, the error message when trying to use dump_data is quite clear:

Error: could not load a required library for this operation.
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringEscapeUtils
Make sure that bcprov and commons-lang3 are installed and included in the
classpath. See also

Unfortunately this message is not relayed to the user by gscan2pdf, making it hard to diagnose what went wrong. I suggest adding java-commons-lang as an optional dependency to gscan2pdf in addition to pdftk since it uses the dump_data operation. Therefore I'll close this in favour of FS#65496.