Thanks. I got the following exceptions when I run "ant -listener
org.apache.alexandria.ant.XMLListener -Dvindico.logfile=log.xml", any idea?
java.lang.NullPointerException
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at java.io.FileOutputStream.<init>(FileOutputStream.java:62)
at java.io.FileWriter.<init>(FileWriter.java:38)
at org.apache.alexandria.ant.XMLListener.buildStarted(XMLListener.java:155)
at org.apache.tools.ant.Project.fireBuildStarted(Project.java:1855)
at org.apache.tools.ant.Main.runBuild(Main.java:581)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235) Total time: 58 seconds
java.lang.NullPointerException
at org.apache.alexandria.ant.XMLListener.buildFinished(XMLListener.java:166)
at org.apache.tools.ant.Project.fireBuildFinished(Project.java:1871)
at org.apache.tools.ant.Main.runBuild(Main.java:629)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
-----Original Message-----
From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
Sent: Wednesday, October 16, 2002 2:14 AM
To: Ant Users List
Subject: Re: custom ant logger
Erik Hatcher wrote:
> Wu, Sherry wrote:
>
>> I tried to modify XmlLogger.java. Instead of flushing the log in
>> buildFinished(),
>> I did it in taskFinished(). This solved the our of memory problem. But
>> some
>> of
>> the tags (e.g. build, build time, target ...) are lost in the output
>> log.xml.
>
>
> There is buffering going on in there that you'd have to adjust for also.
>
>> e.g. unzip error, ANT gives a message like this "-------:163:Errror while
>> expanding-----"
>> copy error, ANT gives a message like this "------ Warning: Could not
>> find
>> file----"
>> file not exist ANT gives a message like this "------ does not exist"
>> We had to look for these exact words in our script to capture these
>> errors.
>> The script does
>> not capture the error if the error message is new.
>
>
> The BuildEvent that gets passed to the BuildLogger methods has an
> exception attached to it. If its not null then there was an error. You
> should not have to do any text matching to determine if there is an
> error. Some tasks will also log informational messages which may "look"
> like errors but are not show stoppers - these come through messageLogged
> instead of the other methods.
>
> Good luck. And if you come up with a better XmlLogger, by all means
> share :))
Scott Sanders made one for Vindico that is lying in Alexandria CVS.
He said IIRC that it's better than current Ant one.
http://cvs.apache.org/viewcvs.cgi/jakarta-alexandria/proposal/vindico/src/ja
va/org/apache/alexandria/ant/XMLListener.java?rev=HEAD&content-type=text/vnd
.viewcvs-markup
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
--
To unsubscribe, e-mail: <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
|