Debian Bug report logs - #586288
fop: log4j not initialized correctly

Package: libbatik-java; Maintainer for libbatik-java is Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>; Source for libbatik-java is src:batik.

Reported by: "brian m. carlson" <sandals@crustytoothpaste.net>

Date: Thu, 25 Mar 2010 16:09:01 UTC

Severity: normal

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>:
Bug#575411; Package fop. (Thu, 25 Mar 2010 16:09:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to "brian m. carlson" <sandals@crustytoothpaste.ath.cx>:
New Bug report received and forwarded. Copy sent to Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>. (Thu, 25 Mar 2010 16:09:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "brian m. carlson" <sandals@crustytoothpaste.ath.cx>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: fop: log4j not initialized correctly
Date: Thu, 25 Mar 2010 16:07:03 +0000
[Message part 1 (text/plain, inline)]
Package: fop
Version: 1:0.95.dfsg-10
Severity: normal

The following warnings occur every time I run fop:

  lakeview ok % fop -v 2>&1 | head -n 2
  log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry).
  log4j:WARN Please initialize the log4j system properly.

The errors occur whether I run fop through ant or at the command line.
They occur with or without an XML configuration file.  As demonstrated,
these occur whether or not any data are actually being processed.

If you need me to test something, please let me know.  If you think this
belongs to log4j, feel free to reassign it.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages fop depends on:
ii  default-jre-headless [jav 1.6-34         Standard Java or Java compatible R
ii  gcj-4.4-jre-headless [jav 4.4.3-5        Java runtime environment using GIJ
ii  gcj-jre-headless [java2-r 4:4.4.3-1      Java runtime environment using GIJ
ii  gij-4.3 [java2-runtime-he 4.3.4-4        The GNU Java bytecode interpreter
ii  java-wrappers             0.1.15         wrappers for java executables
ii  libavalon-framework-java  4.2.0-7        Common framework for Java server a
ii  libbatik-java             1.7-6          xml.apache.org SVG Library
ii  libbsf-java               1:2.4.0-3      Bean Scripting Framework to suppor
ii  libcommons-io-java        1.4-2          Common useful IO related classes
ii  libcommons-logging-java   1.1.1-7        commmon wrapper interface for seve
ii  libxalan2-java            2.7.1-5        XSL Transformations (XSLT) process
ii  libxerces2-java           2.9.1-4.1      Validating XML parser for Java wit
ii  libxml-commons-external-j 1.3.05-2       XML Commons external code - DOM, S
ii  libxmlgraphics-commons-ja 1.3.1.dfsg-5   reusable components used by Batik 
ii  libxp6                    1:1.0.0.xsf1-2 X Printing Extension (Xprint) clie
ii  libxt6                    1:1.0.7-1      X11 toolkit intrinsics library
ii  libxtst6                  2:1.1.0-2      X11 Testing -- Resource extension 
ii  openjdk-6-jre-headless [j 6b18~pre3-1    OpenJDK Java runtime, using Hotspo

Versions of packages fop recommends:
ii  libsaxon-java                 1:6.5.5-6  The Saxon XSLT Processor

Versions of packages fop suggests:
ii  fop-doc                   1:0.95.dfsg-10 Documentation for fop
ii  libservlet2.4-java        5.0.30-12      Servlet 2.4 and JSP 2.0 Java libra

-- no debconf information

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>:
Bug#575411; Package fop. (Thu, 17 Jun 2010 23:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gabriel Corona <gabriel.corona@enst-bretagne.fr>:
Extra info received and forwarded to list. Copy sent to Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>. (Thu, 17 Jun 2010 23:39:03 GMT) Full text and rfc822 format available.

Message #10 received at 575411@bugs.debian.org (full text, mbox):

From: Gabriel Corona <gabriel.corona@enst-bretagne.fr>
To: 575411@bugs.debian.org
Subject: Re: fop: log4j not initialized correctly
Date: Fri, 18 Jun 2010 01:36:00 +0200
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>:
Bug#575411; Package fop. (Fri, 18 Jun 2010 07:15:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vincent Fourmond <fourmond@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>. (Fri, 18 Jun 2010 07:15:06 GMT) Full text and rfc822 format available.

Message #15 received at 575411@bugs.debian.org (full text, mbox):

From: Vincent Fourmond <fourmond@debian.org>
To: Gabriel Corona <gabriel.corona@enst-bretagne.fr>, 575411@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#575411: fop: log4j not initialized correctly
Date: Fri, 18 Jun 2010 09:12:49 +0200
clone 575411 -1
reassign -1 libbatik-java
thanks

  Hi,

On Fri, Jun 18, 2010 at 1:36 AM, Gabriel Corona
<gabriel.corona@enst-bretagne.fr> wrote:
> 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 "$@"

  [...]

  Many thanks; the problem is also present in batik (actually, I'm
wonder if this isn't where the original problem is coming). I'll try
to fix is relatively soon ;-)...

  Cheers,

      Vincent




Bug 575411 cloned as bug 586288. Request was from Vincent Fourmond <fourmond@debian.org> to control@bugs.debian.org. (Fri, 18 Jun 2010 07:15:06 GMT) Full text and rfc822 format available.

Bug reassigned from package 'fop' to 'libbatik-java'. Request was from Vincent Fourmond <fourmond@debian.org> to control@bugs.debian.org. (Fri, 18 Jun 2010 07:15:09 GMT) Full text and rfc822 format available.

Bug No longer marked as found in versions fop/1:0.95.dfsg-10. Request was from Vincent Fourmond <fourmond@debian.org> to control@bugs.debian.org. (Fri, 18 Jun 2010 07:15:10 GMT) Full text and rfc822 format available.

Changed Bug submitter to '"brian m. carlson" <sandals@crustytoothpaste.net>' from '"brian m. carlson" <sandals@crustytoothpaste.ath.cx>' Request was from "brian m. carlson" <sandals@crustytoothpaste.net> to control@bugs.debian.org. (Thu, 03 Feb 2011 20:52:16 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>:
Bug#586288; Package libbatik-java. (Mon, 11 Jul 2011 13:45:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gabriel Corona <gabriel.corona@enst-bretagne.fr>:
Extra info received and forwarded to list. Copy sent to Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>. (Mon, 11 Jul 2011 13:45:09 GMT) Full text and rfc822 format available.

Message #28 received at 586288@bugs.debian.org (full text, mbox):

From: Gabriel Corona <gabriel.corona@enst-bretagne.fr>
To: 586288@bugs.debian.org
Cc: florian.haas@linbit.com
Subject: Re: fop: log4j not initialized correctly
Date: Mon, 11 Jul 2011 15:42:15 +0200
Hello,

Shouldn't this be fixed in commons-logging ?

Removing the classpath entry from MANIFEST-MF
(06_classpath_manifest.patch in commons-logging)
should fix the problem in applications.
Individual applications might want to add log4j in their
classpath to make their log4j.properties settings work.

As an added bonus it avoids loading lots of JAR for
nothing in the JVM (servlet-api) and might event prevent
problems.
On my setup, running fop loads both
servlet-api2.4 and servlet-api2.5. Can't this cause
problems for example in an application using
the servlet 2.5 API (in case the 2.4 is used by the
classloader) or the 3.0 servlet API ?

--
Gabriel






Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 13:14:42 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.