Re: Misleading error reporting with imports
On Monday 03 November 2003 17:54, Dominique Devienne wrote: From: peter reilly [mailto:[EMAIL PROTECTED] On Monday 03 November 2003 16:51, Stefan Bodewig wrote: [EMAIL PROTECTED] tmp]$ ant -f import_import_import_bad_import.xml Buildfile: import_import_import_bad_import.xml BUILD FAILED /tmp/import_import_import_bad_import.xml:2: Error executing import file /tmp/import_import_bad_import.xml:2: Error executing import file /tmp/import_bad_import.xml:2: Error executing import file /tmp/bad.xml:2: The content of elements must consist of well-formed character data or markup. Total time: 0 seconds ;-) Is this ok? Also should I do this for [sub]ant[call] ? It's like to see it for ant and subant. antcall, I'm not sure. --DD The place this can be done is in Ant.java, ant, subant, antcall and antcontrib:foreach will then automaticlly pick up the behaviour. Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Misleading error reporting with imports
On Tue, 21 Oct 2003, Dominique Devienne [EMAIL PROTECTED] wrote: The error message doesn't specify which build file failed to parse correctly, I think it did, as the message must have come from an IOException, so the error actually is in recurse.xml not in the file it is trying to import. At least I think so. It will now tell you which file/URL caused the exception, though. and furthermore, the error is reported to occur in recurse.xml, never mentioning that recurse.xml was in fact imported from build.xml or at which line. This is a bit harder to track down and put into the error message, I'm afraid. Currently we don't keep track of that at all AFAICS, we only record that a file has been imported, but not from where. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Misleading error reporting with imports
From: Stefan Bodewig [mailto:[EMAIL PROTECTED] On Tue, 21 Oct 2003, Dominique Devienne [EMAIL PROTECTED] wrote: The error message doesn't specify which build file failed to parse correctly, I think it did, as the message must have come from an IOException, so the error actually is in recurse.xml not in the file it is trying to import. At least I think so. No, really Stefan! recurse.xml was doing a subant on rescue.xml, and it's rescue.xml which failed to parse (like I said, because rescue.xml was doing an entity include of a URI using a custom URL protocol not enabled during this run. FTR, I was replacing entity include using that protocol with import). So Filters.xml was importing recurse.xml recurse.xml was subant'ing rescue.xml rescue.xml failed to parse because of the entity include (see above) And *still* the error messages never mentioned that *rescue.xml* failed to parse, and simply reported on IOException in recurse.xml, never mentioning as well that recurse.xml was itself imported by Filters.xml. I don't know what layer is at fault here, but the proper error should have reported that rescue.xml failed to parse, from subant at line XYZ in recurse.xml, imported from Filters.xml at line ABC. Without this kind of clear and detailed error report, import and [sub]ant will not mix happily! and furthermore, the error is reported to occur in recurse.xml, never mentioning that recurse.xml was in fact imported from build.xml or at which line. This is a bit harder to track down and put into the error message, I'm afraid. Currently we don't keep track of that at all AFAICS, we only record that a file has been imported, but not from where. As I said above, I think it's absolutely necessary Ant does this! --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Misleading error reporting with imports
I had the same problem with antlib. I have now copied the logic from antlib to import, so build exceptions during import parsing should now report the imported and importing files in an emacs friendly form. BUILD FAILED /home/preilly/cvs/ant/src/etc/testcases/taskdefs/import/import_bad_import.xml:2: Error executing import file /home/preilly/cvs/ant/src/etc/testcases/taskdefs/import/bad.xml:2: The content of elements must consist of well-formed character data or markup. Where import_bad_import.xml is: project import file=bad.xml/ /project and bad.xml is: project /project Peter On Monday 03 November 2003 16:06, Dominique Devienne wrote: From: Stefan Bodewig [mailto:[EMAIL PROTECTED] On Tue, 21 Oct 2003, Dominique Devienne [EMAIL PROTECTED] wrote: The error message doesn't specify which build file failed to parse correctly, I think it did, as the message must have come from an IOException, so the error actually is in recurse.xml not in the file it is trying to import. At least I think so. No, really Stefan! recurse.xml was doing a subant on rescue.xml, and it's rescue.xml which failed to parse (like I said, because rescue.xml was doing an entity include of a URI using a custom URL protocol not enabled during this run. FTR, I was replacing entity include using that protocol with import). So Filters.xml was importing recurse.xml recurse.xml was subant'ing rescue.xml rescue.xml failed to parse because of the entity include (see above) And *still* the error messages never mentioned that *rescue.xml* failed to parse, and simply reported on IOException in recurse.xml, never mentioning as well that recurse.xml was itself imported by Filters.xml. I don't know what layer is at fault here, but the proper error should have reported that rescue.xml failed to parse, from subant at line XYZ in recurse.xml, imported from Filters.xml at line ABC. Without this kind of clear and detailed error report, import and [sub]ant will not mix happily! and furthermore, the error is reported to occur in recurse.xml, never mentioning that recurse.xml was in fact imported from build.xml or at which line. This is a bit harder to track down and put into the error message, I'm afraid. Currently we don't keep track of that at all AFAICS, we only record that a file has been imported, but not from where. As I said above, I think it's absolutely necessary Ant does this! --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Misleading error reporting with imports
[EMAIL PROTECTED] tmp]$ ant -f import_import_import_bad_import.xml Buildfile: import_import_import_bad_import.xml BUILD FAILED /tmp/import_import_import_bad_import.xml:2: Error executing import file /tmp/import_import_bad_import.xml:2: Error executing import file /tmp/import_bad_import.xml:2: Error executing import file /tmp/bad.xml:2: The content of elements must consist of well-formed character data or markup. Total time: 0 seconds ;-) Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Misleading error reporting with imports
On Mon, 3 Nov 2003, Dominique Devienne [EMAIL PROTECTED] wrote: From: Stefan Bodewig [mailto:[EMAIL PROTECTED] On Tue, 21 Oct 2003, Dominique Devienne [EMAIL PROTECTED] wrote: The error message doesn't specify which build file failed to parse correctly, I think it did, as the message must have come from an IOException, so the error actually is in recurse.xml not in the file it is trying to import. At least I think so. No, really Stefan! recurse.xml was doing a subant on rescue.xml, and it's rescue.xml which failed to parse (like I said, because rescue.xml was doing an entity include of a URI using a custom URL protocol not enabled during this run. Well, as it was an IOException, I expected it to be a problem with the importing file. I would expect a SAX exception if it was in the imported one. But an invalid URL may result in IOExceptions, of course. Sorry Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Misleading error reporting with imports
This is the way antlib works I suppose it would be better to do /tmp/bad.xml:2: The content of elements must consist of well-formed character data or markup. Imported by /tmp/import_bad_import.xml:2: Imported by /tmp/import_import_bad_import.xml:2: Putting the filename at the start of the line allows emacs next-error (and other error detection ides using emacs style errors) to locate the file (s). Peter On Monday 03 November 2003 16:51, Stefan Bodewig wrote: [EMAIL PROTECTED] tmp]$ ant -f import_import_import_bad_import.xml Buildfile: import_import_import_bad_import.xml BUILD FAILED /tmp/import_import_import_bad_import.xml:2: Error executing import file /tmp/import_import_bad_import.xml:2: Error executing import file /tmp/import_bad_import.xml:2: Error executing import file /tmp/bad.xml:2: The content of elements must consist of well-formed character data or markup. Total time: 0 seconds ;-) Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Misleading error reporting with imports
On Monday 03 November 2003 16:51, Stefan Bodewig wrote: [EMAIL PROTECTED] tmp]$ ant -f import_import_import_bad_import.xml Buildfile: import_import_import_bad_import.xml BUILD FAILED /tmp/import_import_import_bad_import.xml:2: Error executing import file /tmp/import_import_bad_import.xml:2: Error executing import file /tmp/import_bad_import.xml:2: Error executing import file /tmp/bad.xml:2: The content of elements must consist of well-formed character data or markup. Total time: 0 seconds ;-) Is this ok? Also should I do this for [sub]ant[call] ? Peter Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Misleading error reporting with imports
From: peter reilly [mailto:[EMAIL PROTECTED] On Monday 03 November 2003 16:51, Stefan Bodewig wrote: [EMAIL PROTECTED] tmp]$ ant -f import_import_import_bad_import.xml Buildfile: import_import_import_bad_import.xml BUILD FAILED /tmp/import_import_import_bad_import.xml:2: Error executing import file /tmp/import_import_bad_import.xml:2: Error executing import file /tmp/import_bad_import.xml:2: Error executing import file /tmp/bad.xml:2: The content of elements must consist of well-formed character data or markup. Total time: 0 seconds ;-) Is this ok? Also should I do this for [sub]ant[call] ? It's like to see it for ant and subant. antcall, I'm not sure. --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Misleading error reporting with imports
Before opening a BugZilla issue, I'll post what I'm seing: I have a 'recursing' build file (build.xml), that imports recurse.xml to do the actual recursing (build.xml just specify which subdirs to recurse into), and the build file I'm recursing into (rescue.xml) fails to parse correctly for good reasons (because using a custom URL protocol no longer defined). Look at the error message below: P:\com_lgc\10.0.7\gocad\T-Surf\Filtersbuild -Dmsdev=false Buildfile: P:\com_lgc\10.0.7\gocad\T-Surf\Filters\build.xml BUILD FAILED P:\com_lgc\10.0.7\gocad\config\recurse.xml:40: Error reading project file: unknown protocol: resource Total time: 2 seconds The error message doesn't specify which build file failed to parse correctly, and furthermore, the error is reported to occur in recurse.xml, never mentioning that recurse.xml was in fact imported from build.xml or at which line. Add a level or two of importing and/or one or two ant/antcall/subant layer, and it quickly becomes a real headache to troubleshoot a problem. Even in this simple case, I was confused, when I'm the writers of all the build files. Had to resort to -debug scrutinizing to figure it out, even that is not easy at all. The debug out somehow shows the same references being set several times, reports about imported build files several times, etc... I *really* hope we would somehow improve on this situation before Ant 1.6 release. October 30 sounds like a hasty release date. --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]