Bug#575411: fop: log4j not initialized correctly

Gabriel Corona gabriel.corona at enst-bretagne.fr
Thu Jun 17 23:36:00 UTC 2010


Hello,

A quick fix is to add either :
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
or
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
in the last command of /usr/bin/fop :
run_java
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
$HEADLESS org.apache.fop.cli.Main "$@"

The longer answer is that according to
http://commons.apache.org/logging/guide.html#Configuration
the default loggin backend is log4j backend if it is found in the classpath.
Otherwise, the default is to use the JDK 1.4 Logging backend.
The default backend is overloaded with the org.apache.commons.logging.Log
option.

When using the log4j backend a log4j.properties is searched in the
classpath.
Otherwise the "No appenders could be found for logger" is displayed
and the errors messages are not displayed.

The reason log4j is found in the classpath
is that it is in the classpath of the manifest of commons-loggin.jar.
This is implemented by the patch 06_classpath_manifest.patch
of the commons-logging package.
So maybe the bug should belong to commons-logging instead ?

One solution would be to add a log4j.properties files to fop
or to explicitly change the backend with the
org.apache.commons.logging.Log option
(but the same problem may occur in other packages).

Another solution is to remove the log4j package from the
classpath of commons-logging manifest
(I guess it should not break things).
The good thing is that the backend selection process of
commons-logging would select the JDK 1.4 backend
unless log4js is explicitly in the classpath.

I've never used commons-logging so parts of what I'm saying
may not be accurate.

-- 
Gabriel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/attachments/20100618/dfcb4d0e/attachment.htm>


More information about the pkg-java-maintainers mailing list