Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'DOCTYPE is disallowed' in build script (gradle 2.1) #30

Open
wants to merge 3 commits into
base: branch_9_5_x
Choose a base branch
from

Conversation

gallardo
Copy link

Using gradle 2.1 the build script fails with the following message:

[Fatal Error] SerialDateWidget.gwt.xml:2:10: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.

The build script uses the default XmlParser. This is 'a non-validating and non-namespace-aware XmlParser which does not allow DOCTYPE declarations in documents'. Correcting it to use a parser that does allow DOCTYPE declarations still tries to fetch an external DTD and fails with a:

[Fatal Error] SerialDateWidget.gwt.xml:2:172: External DTD: Failed to read external DTD 'gwt-module.dtd', because 'http' access is not allowed due to restriction set by the accessExternalDTD property.

Setting the load-external-dtd feature to false fixes the failure.

Using gradle 2.1 the build script fails with the following message:

    [Fatal Error] SerialDateWidget.gwt.xml:2:10: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.

The build script uses the default XmlParser. This is 'a non-validating and non-namespace-aware XmlParser which does not allow DOCTYPE declarations in documents'. Correcting it to use a parser that does allow DOCTYPE declarations still tries to fetch an external DTD and fails with a:

    [Fatal Error] SerialDateWidget.gwt.xml:2:172: External DTD: Failed to read external DTD 'gwt-module.dtd', because 'http' access is not allowed due to restriction set by the accessExternalDTD property.


Setting the `load-external-dtd` feature to false fixes the failure.
...erroneously copied when creating patch
@gallardo gallardo changed the title Fix 'DOCTYPE is disallowed' in build script Fix 'DOCTYPE is disallowed' in build script (gradle 2.1) Sep 30, 2014
@gallardo
Copy link
Author

gallardo commented Oct 1, 2014

Warning: This fix only works for groovy >=2_2_0_RC2 or groovy >=2_1_9+. (Packaged with Gradle >= 2.0)

Groovy < 2.1.9 doesnt have the XmlParser(boolean,boolean,boolean) constructor. For these groovy versions, the default XmlParser() returns an appropriate parser that needs not be tuned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant