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.
I just casually tried to validate a typical update XML file and found it full of errors. Here is a sample from 35_1.6_.xml: Checking file:/space/src/nb_all/www/www/updates/alpha/35_1.6_.xml... Referenced entity at "http://www.netbeans.org/dtds/autoupdate-catalog-1_0.dtd". Referenced entity at "file:/space/src/nb_all/www/www/updates/alpha/35_alpha_release.ent". Referenced entity at "file:/space/src/nb_all/www/www/updates/alpha/35_alpha_daily.ent". Attribute "OpenIDE-Module-Deprecated" must be declared for element type "manifest". [856] Attribute "OpenIDE-Module-Deprecation-Message" must be declared for element type "manifest". [856] Attribute "OpenIDE-Module-Deprecated" must be declared for element type "manifest". [930] Attribute "OpenIDE-Module-Deprecation-Message" must be declared for element type "manifest". [930] Attribute "OpenIDE-Module-Module-Install" must be declared for element type "manifest". [1,224] Attribute "OpenIDE-Module-Name" is required and must be specified for element type "manifest". [2,529] The content of element type "module_group" must match "(module_group|module)*". [14] The content of element type "module_updates" must match "((notification?,(module_group|module)*,license*)|error)". [16] XML validation finished. And for dev it is even worse: Checking file:/space/src/nb_all/www/www/updates/alpha/dev_1.6_.xml... Referenced entity at "http://www.netbeans.org/dtds/autoupdate-catalog-1_0.dtd". Referenced entity at "file:/space/src/nb_all/www/www/updates/alpha/dev_alpha_release.ent". Referenced entity at "file:/space/src/nb_all/www/www/updates/alpha/dev_alpha_daily.ent". Attribute "OpenIDE-Module-Deprecated" must be declared for element type "manifest". [856] Attribute "OpenIDE-Module-Deprecation-Message" must be declared for element type "manifest". [856] Attribute "OpenIDE-Module-Deprecated" must be declared for element type "manifest". [930] Attribute "OpenIDE-Module-Deprecation-Message" must be declared for element type "manifest". [930] Attribute "OpenIDE-Module-Module-Install" must be declared for element type "manifest". [1,224] Attribute "OpenIDE-Module-Name" is required and must be specified for element type "manifest". [2,526] Attribute "distribution" is required and must be specified for element type "module". [2,561] Element type "l10n" must be declared. [2,567] The content of element type "module" must match "(description?,module_notification?,external_package*,manifest)". [2,568] Attribute "distribution" is required and must be specified for element type "module". [2,573] Element type "l10n" must be declared. [2,579] The content of element type "module" must match "(description?,module_notification?,external_package*,manifest)". [2,580] Attribute "distribution" is required and must be specified for element type "module". [2,585] Element type "l10n" must be declared. [2,592] The content of element type "module" must match "(description?,module_notification?,external_package*,manifest)". [2,593] Attribute "distribution" is required and must be specified for element type "module". [2,598] Element type "l10n" must be declared. [2,605] The content of element type "module" must match "(description?,module_notification?,external_package*,manifest)". [2,606] Attribute "distribution" is required and must be specified for element type "module". [2,611] Element type "l10n" must be declared. [2,618] Too many errors, stopping further checking. XML validation finished. (Note that the file is still using the old DOCTYPE declaration even while using 2.0 DTD features!) I *strongly* recommend that the <makenbm> and <makeupdatedesc> tasks, or whatever all you are using, run a full XML validation step as the last thing they do and fail with a build error if it reports that the file is invalid. We cannot be publishing corrupt XML and expect Auto Update to work with it. This should be fixed for 3.5.
Even more ridiculous: note that the public and system ID do not match at all: <!DOCTYPE module_updates PUBLIC "-//NetBeans//DTD Autoupdate Module Info 1.0//EN" "http://www.netbeans.org/dtds/autoupdate-catalog-1_0.dtd" [ ... ]>
This is my code.
Updated public and system ids of alpha/[dev|35]_1.6_.xml update centres. Checking in www/www/updates/alpha/dev_1.6_.xml; /shared/data/helm/cvs/repository/www/www/updates/alpha/dev_1.6_.xml,v <-- dev_1.6_.xml new revision: 1.4; previous revision: 1.3 done Checking in www/www/updates/alpha/35_1.6_.xml; /shared/data/helm/cvs/repository/www/www/updates/alpha/35_1.6_.xml,v <-- 35_1.6_.xml new revision: 1.2; previous revision: 1.1 done
Michal, please implement xml validation in nbbuild/antsrc/org/netbeans/nbbuild/MakeUpdateDesc.java for file desc.getAbsolutePath() just right after the last pw.close() (around line 309). Thanks
Did anyone actually correct the DTD validation errors? If not, this is still a DEFECT.
Ruda fixed the generation of XML according the DTD.
I still consider this a priority. We have fixed a number of validation problems. We have not actually fixed them all (see validation errors in my original comments to this bug), and we could accidentally revert any fixes we made if they are not validated.
There are still validation errors. Besides things already reported elsewhere, there are e.g.: Attribute "OpenIDE-Module-Deprecated" must be declared for element type "manifest". [937] Attribute "OpenIDE-Module-Deprecation-Message" must be declared for element type "manifest". [937] Attribute "OpenIDE-Module-Name" is required and must be specified for element type "manifest". [2,616] Probably many more, but Xerces reports: Too many errors, stopping further checking. due to the huge number of errors caused by issue #32437.
Here's another error that should have been easily caught during creation of the catalog file. Say the NBM does not include a distribution location, i.e. distribution="http://${dist.base}/archiver.nbm" on <makenbm>. This is natural enough; the NBM itself does not know where it will be kept. But <makeupdatedesc> does not *add* it. The resulting catalog file includes an entry with no distribution location. AU then chokes because it was given an invalid entry (issue #33519). Since the distribution location is #REQUIRED in the DTD, this kind of error would have been caught immediately by validation, rather than waiting for someone to come across it by accident.
*** Issue 33519 has been marked as a duplicate of this issue. ***
I would say this was already done months ago.
Not really; I filed issue #57634.