Error loading log4j properties file

From: yzzzzz (lg83news_at_free.fr)
Date: 03/29/05


Date: Tue, 29 Mar 2005 18:57:18 +0200

Hello,

I am experiencing a very strange problem. I am using log4j for logging,
and I *do* have a log4j.properties at the root of my source hierarchy
(in the same directory as all my other .properties files).

However I keep getting these errors saying the file can't be found. I
have checked myself, using:
    mkdir /tmp/a
    cd /tmp/a
    unzip /opt/***/webapp/WEB-INF/lib/***.jar
    vi log4j.properties
The file is THERE!! I am absolutely positive!! But I still get the
errors below every time I restart a webapp (using manager).

HOWEVER, if I restart tomcat, everything works fine, I get no errors,
and the logging works too. This means I have to restart tomcat every
time I recompile, which is quite time consuming.

Any help greatly appreciated. Thanks.

(the stars *** are the name of the project)

Mar 29, 2005 6:46:02 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
log4j:ERROR Could not read configuration file from URL
[jar:file:/opt/***/webapp/WEB-INF/lib/***.jar!/log4j.properties].
java.io.FileNotFoundException: JAR entry log4j.properties not found in
/opt/***/webapp/WEB-INF/lib/***.jar
at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:97)
at
sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:107)
 .......
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
log4j:ERROR Ignoring configuration file
[jar:file:/opt/***/webapp/WEB-INF/lib/***.jar!/log4j.properties].
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.



Relevant Pages

  • Re: Error loading log4j properties file
    ... > I am experiencing a very strange problem. ... I am using log4j for logging, ... > HOWEVER, if I restart tomcat, everything works fine, I get no errors, ... > log4j:ERROR Could not read configuration file from URL ...
    (comp.lang.java.programmer)
  • Logging APIs
    ... I'm familiar with Log4J, I've read about Java 1.4 Logging, used ... Commons logging to sit on top of Log4J (and read an interesting ... the Avalon logging API. ...
    (comp.lang.java.programmer)
  • log4j vs. java 1.4 logging performance
    ... but OptimizeIt (Borland's code profiler) complains that ... log4j is creating too many strings. ... This problem occurs when I turn logging ...
    (comp.lang.java.programmer)
  • Re: Current thinking on logging?
    ... I have found quite a bit on the web discussing Log4j vs JDK logging vs Commons Logging. ... Everything I read says log4j is better, but we ship a commercial app, and I really don't want to include yet another .jar file. ...
    (comp.lang.java.programmer)
  • Re: log4j vs. java 1.4 logging performance
    ... > log4j is creating too many strings. ... > logging to it's lowest levels. ... To avoid the parameter construction cost write: ...
    (comp.lang.java.programmer)