Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 8370 invoked from network); 7 Jun 2007 01:43:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jun 2007 01:43:53 -0000 Received: (qmail 73506 invoked by uid 500); 7 Jun 2007 01:43:53 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 73460 invoked by uid 500); 7 Jun 2007 01:43:52 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 73449 invoked by uid 99); 7 Jun 2007 01:43:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2007 18:43:52 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of canabrav@gmail.com designates 66.249.90.178 as permitted sender) Received: from [66.249.90.178] (HELO ik-out-1112.google.com) (66.249.90.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2007 18:43:47 -0700 Received: by ik-out-1112.google.com with SMTP id b32so300477ika for ; Wed, 06 Jun 2007 18:43:26 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hE2DQ+MQhWACjzDpqu0U1qYjXKq9jQRAWGqGx4P+FiY2VaG5olK/N9KV5LbkSofdFi2+56SjPVcBg/KQOUu9cCoesq05uc1/ZaDPAVZDZ5SeBWVZAXO4foivgNTfiLcSME9JR/IIONXrOLeFyJ3vg2UzrRiFKbH8HggzmBI5ero= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=YSu10gu9HDiesayowv2aRUnF2I71icWocy6QiLQ2vgr8JiyRCPJHpTeHdVt/d2EH6rWX9Wvm83lnK1y1R7+Ygv1USPRuWNzUal6y32zlw0vH1S97TCQieKaSDfA4T5KWDV5v5WXrWia2OJUJmyC2NmsYorzJPAE6tVIA/jOLvvo= Received: by 10.78.134.12 with SMTP id h12mr541585hud.1181180606177; Wed, 06 Jun 2007 18:43:26 -0700 (PDT) Received: by 10.78.83.20 with HTTP; Wed, 6 Jun 2007 18:43:26 -0700 (PDT) Message-ID: <7fc8f9070706061843n22e23b7red192afad44b69a@mail.gmail.com> Date: Wed, 6 Jun 2007 22:43:26 -0300 From: "Rodrigo Canabrava" To: "Jakarta Commons Users List" Subject: Re: commons-logging and log4j headaches In-Reply-To: <46675C6C.5080809@gridsphere.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46675C6C.5080809@gridsphere.org> X-Virus-Checked: Checked by ClamAV on apache.org Jason, you can't include a single properties file in the classpath with the -cp option. It expects directories, or jar files. You should put the properties file in some other directory (for example conf), and put this directory in the classpath. A better option is to put the log4j.properties file with your classes, inside the build/lib/stockstats-1.0.jar. Rodrigo 2007/6/6, Jason Novotny : > > Hi, > > I'm trying to use log4j and commons-logging in the simplest app and I > get the infamous > > log4j:WARN No appenders could be found for logger > (org.stockstats.tools.UpdateSymbols). > log4j:WARN Please initialize the log4j system properly. > > In my classpath, I made sure I have commons-logging, log4j jars and my > log4j.properties file as follows and I even turned on log4j debugging > which claims that no log4j.properties file is found! > > > [fuzzmonkey:~/StockStats] novotny% java -Dlog4j.debug -cp > lib/log4j.properties:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.0.4.jar:lib/log4j.properties:lib/log4j-1.2.11.jar:build/lib/stockstats-1.0.jar:. > org.stockstats.tools.Main > log4j: Trying to find [log4j.xml] using context classloader > sun.misc.Launcher$AppClassLoader@a9c85c. > log4j: Trying to find [log4j.xml] using > sun.misc.Launcher$AppClassLoader@a9c85c class loader. > log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource(). > log4j: Trying to find [log4j.properties] using context classloader > sun.misc.Launcher$AppClassLoader@a9c85c. > log4j: Trying to find [log4j.properties] using > sun.misc.Launcher$AppClassLoader@a9c85c class loader. > log4j: Trying to find [log4j.properties] using > ClassLoader.getSystemResource(). > log4j: Could not find resource: [null]. > log4j:WARN No appenders could be found for logger > (org.stockstats.tools.UpdateSymbols). > log4j:WARN Please initialize the log4j system properly. > > The only way I can get it to work is if I explicitly add > -Dlog4configuration=file:///tmp/log4j.properties to specify the file > location. I just cannot see why it can't find it in the classpath when I > specified it explicitly. > > Thanks, Jason > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org