Hi,

Thank you for your quick reply.

On 2017-09-05 19:17, Markus Koschany wrote:
> [...] Unfortunately there is another
> error. If you try to manipulate a PDF file (e.g. using the extract
> feature), nothing will happen but an error message is logged. It is
> related to libhibernate-java. Downgrading to 4.2.1 makes it go away. If
> you found the solution for this problem, that would be awesome.

I tried to analyse the problem.

The problem seems to be that the jar package inside the Debian package
"libhibernate-validator-java" is missing something needed by pdfsam (or
one of its other dependencies).

Stack trace/error message I got whe trying to extract a page (probably
the one you also get):

~~~
$ pdfsam
INFO  21:39:38.386 o.p.PdfsamApp[JavaFX-Launcher] Starting PDFsam
INFO  21:39:39.344 o.s.c.c.GlobalConfiguration[JavaFX Application
Thread] Configuring Sejda 2.10.4
INFO  21:39:39.971 o.p.PdfsamApp[JavaFX Application Thread] Started in 1
second
INFO  21:40:23.036 o.p.p.SAMBoxPdfLoadService[pool-2-thread-1] pages.pdf
loaded
ERROR 21:41:05.567 org.pdfsam.UncaughtExceptionLogger[pool-3-thread-1]
Unexpected error
java.lang.ExceptionInInitializerError: null
        at
org.hibernate.validator.internal.engine.ConfigurationImpl.<clinit>(ConfigurationImpl.java:63)
        at
org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
        at
javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:173)
        at
org.sejda.core.validation.DefaultValidationContext.<init>(DefaultValidationContext.java:41)
        at
org.sejda.core.validation.DefaultValidationContext.<init>(DefaultValidationContext.java:36)
        at
org.sejda.core.validation.DefaultValidationContext$DefaultValidationContextHolder.<clinit>(DefaultValidationContext.java:70)
        at
org.sejda.core.validation.DefaultValidationContext.getContext(DefaultValidationContext.java:50)
        at
org.sejda.core.service.DefaultTaskExecutionService.validate(DefaultTaskExecutionService.java:97)
        at
org.sejda.core.service.DefaultTaskExecutionService.execute(DefaultTaskExecutionService.java:66)
        at
org.sejda.core.service.DefaultTaskExecutionService.execute(DefaultTaskExecutionService.java:58)
        at
org.pdfsam.task.TaskExecutionController.lambda$request$0(TaskExecutionController.java:87)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Invalid logger interface
org.hibernate.validator.internal.util.logging.Log (implementation not
found in sun.misc.Launcher$AppClassLoader@a09ee92)
        at org.jboss.logging.Logger$1.run(Logger.java:2556)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.logging.Logger.getMessageLogger(Logger.java:2529)
        at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516)
        at
org.hibernate.validator.internal.util.logging.LoggerFactory.make(LoggerFactory.java:28)
        at 
org.hibernate.validator.internal.util.Version.<clinit>(Version.java:27)
        ... 14 common frames omitted
~~~

It does work as expected when building the jar file "manually" from the
same source that is used for the Debian package, e.g by running the
following commands:

~~~
$ apt source libhibernate-validator-jav
$ cd libhibernate-validator-java-4.3.3/
$ mvn clean install -DdisableDocumentationBuild=true
-Dmaven.test.skip=true -s settings-example.xml
~~~

and modifying the respective symlink in order to use that jar file
instead of the one provided by the Debian package (executed from
directory where build was made):

~~~
$ sudo ln -s -f
"${PWD}/engine/target/hibernate-validator-4.3.3.Final.jar"
/usr/share/pdfsam/lib/hibernate-validator.jar
~~~

After doing so, extracting pages works in pdfsam.


The relevant difference between the jar file generated in the Debian
package build process and the one from the "manual build" can be seen in
the directory  "org/hibernate/validator/internal/util/logging/ after
extracting the two jar files (from Debian build and from manual build):

~~~
mkdir -p /tmp/extracted/manual /tmp/extracted/debian
unzip "${PWD}/engine/target/hibernate-validator-4.3.3.Final.jar" -d
/tmp/extracted/manual
unzip /usr/share/java/hibernate-validator.jar -d /tmp/extracted/debian/
~~~

The version from the Debian build is missing files as compared to the
other one.
>From Debian package:

~~~
$ ls -l /tmp/extracted/debian/org/hibernate/validator/internal/util/logging/
total 32
-rw-r--r-- 1 user user 21057 May 13  2016 Log.class
-rw-r--r-- 1 user user   944 May 13  2016 LoggerFactory.class
-rw-r--r-- 1 user user  1894 May 13  2016 Messages.class
~~~

>From jar file built manually:

~~~
$ ls -l /tmp/extracted/manual/org/hibernate/validator/internal/util/logging/
total 144
-rw-r--r-- 1 user user 21057 Sep  6 19:11 Log.class
-rw-r--r-- 1 user user   944 Sep  6 19:11 LoggerFactory.class
-rw-r--r-- 1 user user 22029 Sep  6 19:11 Log.i18n.properties
-rw-r--r-- 1 user user 75030 Sep  6 19:11 Log_$logger.class
-rw-r--r-- 1 user user  4964 Sep  6 19:11 Messages_$bundle.class
-rw-r--r-- 1 user user  1894 Sep  6 19:11 Messages.class
-rw-r--r-- 1 user user  2142 Sep  6 19:11 Messages.i18n.properties
~~~

I could verify that those are the relevant files by replacing the
"logging" directory from the Debian jar file with the one from the
manual build and repacking the jar file. Page extraction in pdfsam works
with the jar created this way.


Unfortunately, I am not experienced with Debian packaging of Maven
projects and do not know what would be the way to fix the issue.

Maybe the above notes can still be helpful to somebody else...


Regards,
Michael

__
This is the maintainer address of Debian's Java team
<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers>. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Reply via email to