Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 28380 invoked from network); 1 Apr 2002 17:51:53 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Apr 2002 17:51:53 -0000 Received: (qmail 356 invoked by uid 97); 1 Apr 2002 17:51:40 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@jakarta.apache.org Received: (qmail 334 invoked by uid 97); 1 Apr 2002 17:51:39 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 323 invoked from network); 1 Apr 2002 17:51:39 -0000 Message-ID: <02bc01c1d9a6$a6f3d240$c12810ac@jny.com> From: "hemant" To: "Struts Users Mailing List" References: <000e01c1d66d$77eb8e70$c12810ac@jny.com> <3CA3494C.7090300@rededc.com.br> <003901c1d684$9fbebff0$c12810ac@jny.com> <3CA3605B.2060703@rededc.com.br> <00e301c1d68c$056dec20$c12810ac@jny.com> Subject: Re: Struts 1.1Beta and Log4J, "No appender" Issue Date: Mon, 1 Apr 2002 12:57:11 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Fellow Loggers, The problem still recurs. I tried to load my StartupManager Servlet which loads the Log4J configuration prior to ActionServlet load but in vain. I still get the following.. log4j: No appenders could be found for category (org.apache.commons.digester.Digester). log4j: Please initialize the log4j system properly The above error seems to be simple to handle but there is an internal mechanism that is trying to discover Log4J and is doing something with it even before I load Log4J (via StartupManager Servlet) myself. If all I need to do is to add an appender, which properties file is it looking for? and where is it looking for? (/classes)??. It definitely is not looking at my log4j.properties as I tried to add the appender there and it did not work. Another question, slightly on a tangent though, I get a "Cannot find ActionMappings or ActionFormBeans collection" while the same struts-config.xml works fine with Struts 1.0.2 Please Advise hemant ----- Original Message ----- From: "hemant" To: "Struts Users Mailing List" Sent: Thursday, March 28, 2002 2:09 PM Subject: Re: Struts 1.1Beta and Log4J, "No appender" Issue > Marcelo > > Thanks, Will try to make sure that Log4J initializes prior to ActionServlet > load. Earlier, I had a Logger class which had a Category instance > initialized in a static block. Looks like my Logger was loaded prior to > ActionServlet with 1.0.2. Now, I guess I have to write a startup servlet and > load it prior to ActionServlet as you said. > > have a good weekend > hemant > > > public class Logger > { > static Category category = Category.getInstance("mpi"); > static { > try > { > > String pc = CommonConstants.LOG4JPATH; > System.out.println("pc is " + pc); > if ((pc.trim().length() > 0) && (null != pc)) > { > Properties pp = new Properties(); > URL url = pp.getClass().getResource(pc); > PropertyConfigurator.configure(url); > } > else > { > BasicConfigurator.configure(); > } > } > catch (Exception e) > { > System.err.println("Error in Configuration: " + e); > } > } > > /////////////////////// > // Lots of methods here for debug(), info(), etc > ////////////////////// > > } > > > > > ----------------------------------------------------------- > > > hemant wrote: > > > The Log4J configuration loaded property when I used Struts 1.0.2. If it > > > worked then, shouldn't it work now with struts 1.1beta? > > > > It worked with 1.0.2, but Struts did not use the commons-logging package > > then, so the log messages weren't printed through Log4j, which is the > > case now. > > > > It seems that you initialize the log4j configuration after the Struts' > > ActionServlet loads, so when the ActionServlet (and the Digester, and > > Beanutils, etc) try to log and log4j is not yet configured, you get that > > error. > > > > I have a servlet that loads some configuration for my application. I've > > set it up so that it loads before the Struts' ActionServlet, so that the > > log4j system is properly initialized when called. Try do do something > > similar. > > > > -- > > []'s > > Marcelo Vanzin > > Touch Tecnologia > > vanza@rededc.com.br > > "Life is too short to drink cheap beer" > > > > > > -- > > To unsubscribe, e-mail: > > > For additional commands, e-mail: > > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: