Results 1 to 3 of 3
  1. #1
    peri is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default log4j not finding log4j.xml "there-aint-no-such-file"

    Hi!
    got a wierd problem. I have third party program which isnt logging. It runs on apache tomcat, and I'v set apache tomcat to run with the -Dlog4j.debug option. The output it produces suggests it cant find the log4j.xml file, or even possibly that it doesnt know what file it is looking for:

    log4j: Trying to find [-there-aint-no-such-file-] using WebappClassLoader
    context: /fedoragsearch
    delegate: false
    repositories:
    /WEB-INF/classes/
    ----------> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@492 9b0e1
    class loader.
    log4j: Trying to find [-there-aint-no-such-file-] using ClassLoader.getSystemResource().
    log4j: Could not find resource: [-there-aint-no-such-file-].

    I'v tried copying the log4j.xml into the application top level folder as well as WEB-INF/classes and also the final set of configuration files (WEB-INF/classes/fgsconfigFinal, but to no avail). I'm not really very familiar with log4j debugging output - does anyone know which is implied by the above? is it the location of log4j.xml it cant find, or does it not even know that its looking for log4j? I'v tried googling log4j and "[-there-aint-no-such-file-] " but havnmt found anything useful!
    any useful pointers gratefully received

  2. #2
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default Re: log4j not finding log4j.xml "there-aint-no-such-file"

    If I remember correctly there should be a log4j.properties file which should have a path where to look for the log4j.xml file. No?
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  3. #3
    peri is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default Re: log4j not finding log4j.xml "there-aint-no-such-file"

    Quote Originally Posted by FlyNn View Post
    If I remember correctly there should be a log4j.properties file which should have a path where to look for the log4j.xml file. No?
    Thanks Flynn
    I found the answer in the end - a context element had been set for another webapp sitting on the same tomcat installation. This was causing tomcat to look for the log4j configuration file or my own application under the wrong relative pathway . Setting a context element for my own app solved the problem

Similar Threads

  1. Replies: 0
    Last Post: 12-07-2012, 09:29 AM
  2. Replies: 3
    Last Post: 10-30-2012, 04:06 PM
  3. Finding MAX value from "file.txt"
    By masterboemi in forum New To Java
    Replies: 3
    Last Post: 04-19-2011, 01:09 AM
  4. Replies: 1
    Last Post: 09-20-2010, 09:32 AM
  5. Replies: 1
    Last Post: 10-20-2008, 08:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •