Bug#874372: pdfsam: Missing dependencies to liblogback-java and libsambox-java

2017-09-06 Thread Markus Koschany
Am 06.09.2017 um 19:56 schrieb Michael Weghorn:
[...]
> $ 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...

Thank you very much. That was helpful. Now I believe that
libhibernate-validator-java or one of its build-dependencies is buggy
and the aforementioned files are not generated as they should be. You
called Maven the usual way and probably downloaded the
build-dependencies from Maven Central. However the Debian package is
self-contained and only uses Debian's system libraries under
/usr/share/maven-repo. I believe that either the maven-processor-plugin
or the
annotation-processor module of hibernate-validator itself are
responsible. At least I see the following warnings:

[INFO] --- maven-processor-plugin:3.3.1:process (process) @
hibernate-validator ---
[WARNING] The POM for org.codehaus.plexus:plexus-compiler-api:jar:2.x is
invalid, transitive dependencies (if any) will not be available, enable
debug logging for more details
[WARNING] The POM for org.codehaus.plexus:plexus-compiler-javac:jar:2.x
is invalid, transitive dependencies (if any) will not be available,
enable debug logging for more details
[WARNING] diagnostic: warning: [options] bootstrap class path not set in
conjunction with -source 1.6
[WARNING] diagnostic: warning: The following options were not recognized
by any processor: '[loggingVersion, translationFilesPath]'

This needs more investigation.

Regards,

Markus



signature.asc
Description: OpenPGP digital signature


Bug#874372: pdfsam: Missing dependencies to liblogback-java and libsambox-java

2017-09-06 Thread Michael Weghorn
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.(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.(DefaultValidationContext.java:41)
at
org.sejda.core.validation.DefaultValidationContext.(DefaultValidationContext.java:36)
at
org.sejda.core.validation.DefaultValidationContext$DefaultValidationContextHolder.(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.(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-- 

Bug#874372: pdfsam: Missing dependencies to liblogback-java and libsambox-java

2017-09-05 Thread Markus Koschany
Am 05.09.2017 um 16:25 schrieb Michael Weghorn:
> Package: pdfsam
> Version: 3.2.5-1
> Severity: normal
> 
> 
> Dear Maintainer,
> 
> when trying to start pdfsam in Debian experimental, that failed
> with the following error message:

Hi,

Thanks for reporting. Indeed I thought at least the dependency on sambox
was automatically added by our build tools but this is apparently not
true. I will add those dependencies soon. 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.

Regards,

Markus



signature.asc
Description: OpenPGP digital signature


Bug#874372: pdfsam: Missing dependencies to liblogback-java and libsambox-java

2017-09-05 Thread Michael Weghorn
Package: pdfsam
Version: 3.2.5-1
Severity: normal


Dear Maintainer,

when trying to start pdfsam in Debian experimental, that failed
with the following error message:

~~~
$ pdfsam
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further 
details.
Exception in Application start method
Exception in Application stop method
Exception in thread "main" java.lang.RuntimeException: Exception in Application 
start method
at 
com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at 
com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: 
ch/qos/logback/classic/encoder/PatternLayoutEncoder
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.sejda.injector.Injector.providers(Injector.java:343)
at org.sejda.injector.Injector.(Injector.java:120)
at org.sejda.injector.Injector.start(Injector.java:102)
at org.pdfsam.PdfsamApp.initInjector(PdfsamApp.java:169)
at org.pdfsam.PdfsamApp.start(PdfsamApp.java:139)
at 
com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
at 
com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at 
com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at 
com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at 
com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at 
com.sun.glass.ui.gtk.GtkApplication.lambda$null$5(GtkApplication.java:139)
... 1 more
Caused by: java.lang.ClassNotFoundException: 
ch.qos.logback.classic.encoder.PatternLayoutEncoder
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 17 more
~~~

After manually installing the package "liblogback-java", starting pdfsam still 
failed, now with the following error message:

~~~
$ pdfsam
INFO  15:53:56.083 o.p.PdfsamApp[JavaFX-Launcher] Starting PDFsam
INFO  15:53:57.408 o.s.c.c.GlobalConfiguration[JavaFX Application Thread] 
Configuring Sejda 2.10.4
Exception in Application start method
INFO  15:53:57.449 o.p.PdfsamApp[JavaFX Application Thread] Closing PDFsam...
Exception in Application stop method
Exception in thread "main" java.lang.RuntimeException: Exception in Application 
start method
at 
com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at 
com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.sejda.injector.InjectionException: Can't instantiate 
org.pdfsam.task.TaskExecutionController
at org.sejda.injector.Injector.lambda$provider$4(Injector.java:188)
at 
org.sejda.injector.Injector.lambda$singletonProvider$6(Injector.java:230)
at org.sejda.injector.Injector.lambda$new$3(Injector.java:134)
at java.lang.Iterable.forEach(Iterable.java:75)
at org.sejda.injector.Injector.(Injector.java:134)
at org.sejda.injector.Injector.start(Injector.java:102)
at org.pdfsam.PdfsamApp.initInjector(PdfsamApp.java:169)
at org.pdfsam.PdfsamApp.start(PdfsamApp.java:139)
at 
com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
at 
com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at 
com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at 
com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at 
com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at 
com.sun.glass.ui.gtk.GtkApplication.lambda$null$5(GtkApplication.java:139)
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at