Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 30223 invoked from network); 2 Sep 2004 12:18:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Sep 2004 12:18:30 -0000 Received: (qmail 95851 invoked by uid 500); 2 Sep 2004 12:18:27 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 95807 invoked by uid 500); 2 Sep 2004 12:18:26 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 95793 invoked by uid 99); 2 Sep 2004 12:18:26 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [212.227.126.188] (HELO moutng.kundenserver.de) (212.227.126.188) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 02 Sep 2004 05:18:24 -0700 Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1C2qXk-0004UC-00 for dev@ant.apache.org; Thu, 02 Sep 2004 14:18:20 +0200 Received: from [213.183.164.54] (helo=dynadsl-213-183-164-054.ewe-ip-backbone.de) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1C2qXk-0003Ub-00 for dev@ant.apache.org; Thu, 02 Sep 2004 14:18:20 +0200 From: Robert Virkus Organization: Enough Software To: "Ant Developers List" Subject: Re: Integrating own BuildLogger Date: Thu, 2 Sep 2004 14:18:18 +0200 User-Agent: KMail/1.6.2 References: <200409012353.45275.robert@enough.de> <4136D18C.7010206@cortexebusiness.com.au> In-Reply-To: <4136D18C.7010206@cortexebusiness.com.au> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409021418.18657.robert@enough.de> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:ad665ec02ba57e32ad0f56b16f32e139 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Conor, thanks a lot for your quick help - now it works! I'm now using a simple Class.forName(), which works as well: try { // force class loading, so that no additional build-event // is triggered when the messageLogged()-method // is invoced: Class.forName( "org.apache.tools.ant.BuildEvent" ); } catch (ClassNotFoundException e) { e.printStackTrace(); throw new BuildException("Unable to load BuildEvent from the classpath.", e); } Thanks again, Robert On Thursday 02 September 2004 09:53, Conor MacNeill wrote: > Robert Virkus wrote: > > Hi everyone, > > > > I am trying to substitute the original build logger in my task with Ant > > 1.6.1. I have written a wrapper-class which just forwards the events to > > the original build logger, which works fine as long as I don't try to > > modify the build events. When I change a build event, however, Ant is > > stopping the execution with the message "BUILD FAILED > > Listener attempted to access System.out - infinite loop terminated" > > This is an interesting problem. Nothing you're doing sounds like a > problem but somewhere something in your message handling is attempting > to output a message. i.e. before one message has been delivered to the > listeners something is attempting to send another. The message above > gives the most common cause but it is in fact not the only possibility > as I found when trying to sort out your problem. > > Since your logger is loaded by an AntClassLoader it is susceptible to > any logging done by that classloader. In fact I reproduced your problem > and here is the stack trace > > Listener attempted to access System.out - infinite loop terminated > at > org.apache.tools.ant.Project.fireMessageLoggedEvent(Project.java:1991) > at > org.apache.tools.ant.Project.fireMessageLogged(Project.java:2020) > at org.apache.tools.ant.Project.log(Project.java:387) > at > org.apache.tools.ant.AntClassLoader.log(AntClassLoader.java:394) at > org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:974) > at java.lang.ClassLoader.loadClass(ClassLoader.java:236) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:303) > at PolishLogger.messageLogged(PolishLogger.java:32) > > So the deferred classloading that is triggered in your messageLogged > method causes the AntClassLoader to log a message (a class being loaded). > > The workaround is to trigger the class loading earlier. I changed the > PolishLogger constructor as follows: > > public PolishLogger(BuildLogger realLogger, Project project) > { > this.logger = realLogger; > BuildEvent event = new BuildEvent(project); > String s = new String(); > StringBuffer sb = new StringBuffer(); > } > > > Note that it is not easy to ensure you have got all the classes loaded. > A better solution might be to not load the PolishLogger through the > AntClassLoader. > > Conor > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org -- Robert Virkus Enough Software Vor dem Steintor 218 D-28203 Bremen Germany www.enough.de robert@enough.de SAY NO TO SOFTWARE PATENTS: http://www.ffii.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org