Menu

Log4j -- Properties file not found

wfay
2005-10-11
2013-04-25
  • wfay

    wfay - 2005-10-11

    I've been getting the following error when I run SQLUnit using the sqlunit-4.9.jar that is pre-built with the 4.9 distribution:

    [sqlunit]  WARN [main] (SQLUnit.java:168) - log4j.properties not found (using defaults)

    I'm a regular user of Ant and Log4j but a recent SQLUnit convert. After seeing that log4j warning for a few days, I finally decided to resolve the issue.

    I copied my log4j.properties file to my project home directory (alongside my build.xml and build.properties files). Still got the error.

    Then copied the log4j.properties file to every subdir under the project home. Same results.

    Eventually I copied the log4j.properties file into the sqlunit-4.9.jar itself, in the root directory of the archive, along with sqlunit.dtd and META-INF and net subdirectories. This finally resolved the problem and I have not seen the warning since.

    But this is not ideal, obviously. I'd prefer to have an external log4j.properties file so I can have one copy of the sqlunit-4.9.jar file in my classpath and then various properties files in the different project directories.

    I'm sure I'm not the only one. Consider this a bug report. :)

     
    • Sujit Pal

      Sujit Pal - 2005-12-17

      Hi Wayne,

      I have been rethinking this entire logging deal for version 5.0 to remove the internal dependency (the using defaults thing) on log4j.

      However, you should be able to put it anywhere in your classpath for it to be visible. I have my local copy in my project root and have . (cwd) in my definition for system.class.path and it works for me. I think that putting it in the root of the jar works for you because your classpath points to sqlunit.jar and this includes it.

      -sujit

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.