ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: How grab output to "System.out"?
Date Fri, 30 Jan 2004 23:12:06 GMT
On Sat, 31 Jan 2004 03:37 am, Robert Paris wrote:
> >System.setOut(new PrintStream(new DemuxOutputStream(project, false)))
>
> When I use the above code, I get the following error (when I call
> project.executeTask( .. )):
>
> Listsner attempted to access System.out - infinite loop terminated
> at org.apache.tools.ant.Project.fireMessageLoggedEvent.....
>
> Any idea why I'm getting this? Is there another way to grab that
> outputstream?

As it says, I assume your listener attempted to System.out.println() 
something. Is this the case? If so, think about what happens. Something 
generates output to System.out. This is redirected to the Ant message event 
system and sent to your listener. If the listener (or any class it uses) 
accesses System.out while processing that message, there will be an infinite 
loop. The Ant message event system detects that case and terminates the loop.

Remove any usage of System.out in your listener and it should be OK. The 
stacktrace can probably help you trackdown where this is happening.

Conor


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message