This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 60295 - No reasonable error description when one of project.xml is broken
Summary: No reasonable error description when one of project.xml is broken
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-20 16:51 UTC by Martin Adamek
Modified: 2005-09-05 09:51 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Standard output of ant (6.90 KB, text/plain)
2005-06-21 06:10 UTC, Martin Adamek
Details
Verbose aoutput of ant (945.09 KB, text/plain)
2005-06-21 06:11 UTC, Martin Adamek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Adamek 2005-06-20 16:51:54 UTC
When project.xml of some module is broken I cannot:
- build IDE
- open any project in IDE

This is error message from "ant build-nozip":
build-init:
Scanning for modules in /local/madamek/nbcvs/trunk/nb_all
  [nbmerge] Failed to build target: all-openide/util

BUILD FAILED
/local/madamek/nbcvs/trunk/nb_all/nbbuild/build.xml:3127: The following error
occurred while executing this line:
/local/madamek/nbcvs/trunk/nb_all/nbbuild/build.xml:3122: The following error
occurred while executing this line:
/local/madamek/nbcvs/trunk/nb_all/nbbuild/build.xml:264: The following error
occurred while executing this line:
/local/madamek/nbcvs/trunk/nb_all/nbbuild/templates/projectized.xml:23:
java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.

I don's think it's appropriate error message when this error was cause:
- In nb_all/serverplugins/docs/nbproject/projects.xml there was COPYRIGHT
character. File is declared as UTF-8, but it really isn't in this encoding
probably. 

Thanks to Andrei to find this out using "strace" command.
Comment 1 Jesse Glick 2005-06-20 20:35:15 UTC
Can be fixed soon to skip that module. (If that module was needed by something
else, the build may well break later anyway.) Not a top priority, though - just
fix your project.xml. (Error message from Ant task reports broken file name, at
least when I try it.)
Comment 2 Jesse Glick 2005-06-20 22:25:00 UTC
I will make it nonfatal for opening the project in the IDE, but leave it as a
fatal build error for the Ant task. Generally, if some module has malformed XML,
the build cannot be expected to work. (For an XML parser, a misuse of the (C)
char is an error just as bad as missing a closing tag or anything else.)

I don't know what you were using strace for; for me this kind of error is
printed by Ant, without even using -v:

---%<---
[.....]
Scanning for modules in /space/src/nb_all
[Fatal Error] project.xml:1:1: Content is not allowed in prolog.

BUILD FAILED
/space/src/nb_all/nbbuild/templates/projectized.xml:23: java.io.IOException:
org.xml.sax.SAXException: Error parsing
/space/src/nb_all/beans/nbproject/project.xml
Content is not allowed in prolog.
---%<---
Comment 3 Martin Adamek 2005-06-21 06:10:51 UTC
Created attachment 22813 [details]
Standard output of ant
Comment 4 Martin Adamek 2005-06-21 06:11:57 UTC
Created attachment 22814 [details]
Verbose aoutput of ant
Comment 5 Martin Adamek 2005-06-21 06:18:37 UTC
I attached standard and verbose output of "ant build-nozip" command.
There is no information which file is broken.
For me (according to Bug Priority Guidelines) it's still P1 - there is no
workaround. If I would see reasonable error message with broken file location,
this issue would not exist.
Anyway, I don't care if it's P1 or P5 if it is fixed :-)
Comment 6 Andrei Badea 2005-06-21 07:27:56 UTC
Jesse, the project.xml file which started all this is here:

http://serverplugins.netbeans.org/nonav/source/browse/*checkout*/serverplugins/docs/nbproject/project.xml?rev=1.5&content-type=text/plain

The XML is well-formed and valid, but claims to be UTF-8-encoded, which it is
probably not. When the parseprojectxml task processes this file, it stops with
the message that Martin posted in the description, and that message gives no
clue what is the problem or how to fix it.

Making in non-fatal when opening the project in the IDE seems a good idea. But
the build should IMHO immediately fail, and it should be clear from the error
message what went wrong (or at least in which file). In this case, displaying
the file name should be enough.
Comment 7 Petr Jiricka 2005-06-21 08:47:45 UTC
Regarding the priority - Martin spent the whole day before he and Andrei finally
figured out what was wrong and which file caused it. This was not a 10 minute
fix. Hence, I think the P1 priority is justified. Thanks.
Comment 8 Jesse Glick 2005-06-21 17:13:28 UTC
It seems that Yarda patched ModuleListParser to include filename info for
SAXException's (the common case) but not for IOException's (relatively rare).
Easy enough to fix.
Comment 9 Jesse Glick 2005-06-21 18:41:58 UTC
committed   * Up-To-Date  1.7        
apisupport/project/src/org/netbeans/modules/apisupport/project/universe/ModuleList.java
committed   * Up-To-Date  1.15       
nbbuild/antsrc/org/netbeans/nbbuild/ModuleListParser.java