You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ben Leedham (JIRA)" <ji...@codehaus.org> on 2010/04/20 15:54:12 UTC

[jira] Commented: (MSITE-440) Site document validation fails if unable to retrieve schema (in offline mode)

    [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=218340#action_218340 ] 

Ben Leedham commented on MSITE-440:
-----------------------------------

I recently got hit with the issue of:

org.apache.maven.doxia.siterenderer.RendererException: Error parsing '/workspace/src/site/xdoc/xdoc.xml': line [-1] Error validating the model: Method failed: HTTP/1.0 403

This was to do with me being behind a proxy with a whitelist. I had whitelist entries for the domains specified in my namespace declarations ( w3.org and maven.apache.org ) so it was confusing as to why it would fail.

The reason it fails is because I was using version 2.1 of the site plugin which specifies version 1.1.2 of doxia as a dependency.

In version 1.1.2 of doxia the org.apache.maven.doxia.parser.AbstractXmlParsers validate method tries to validate the Xdoc XML if it has a DOCTYPE or schema specified. When creating the XMLReader object it arbitrarily adds 2 schema files to it:

            xmlReader = XMLReaderFactory.createXMLReader( "org.apache.xerces.parsers.SAXParser" );
            xmlReader.setFeature( "http://xml.org/sax/features/validation", true );
            xmlReader.setFeature( "http://apache.org/xml/features/validation/schema", true );

This obviously caused a problem with my whitelist as those specific domains weren't included.

Like I say that validation only occurs if you specify DOCTYPE or schemas in your Xdoc files, so leaving them out should skip the validation.

In version 2.0 of the site plugin doxia-1.0 is specified as the dependency and this does no validation.

Hope that helps.

> Site document validation fails if unable to retrieve schema (in offline mode)
> -----------------------------------------------------------------------------
>
>                 Key: MSITE-440
>                 URL: http://jira.codehaus.org/browse/MSITE-440
>             Project: Maven 2.x Site Plugin
>          Issue Type: Bug
>          Components: doxia integration
>    Affects Versions: 2.1
>         Environment: Maven 2.2.1
> Site Plugin 2.1-SNAPSHOT
> Doxia 1.1.2
>            Reporter: Dave Meibusch
>            Priority: Critical
>             Fix For: 2.1.1
>
>
> The changes included DOXIA-263 to validate XML documents retrieves the DTD/Schema to validate the document.
> For example, for FML, xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 http://maven.apache.org/xsd/fml-1.0.1.xsd" the Doxia FML parser will retrieve http://maven.apache.org/xsd/fml-1.0.1.xsd before validating the document.
> If in offline mode, or in an environment without connectivity to apache.org, site generation will appear to hang until the HTTP client code times out (which is many minutes for each retry) then fail.
> Workaround: remove the schema definition from the document (and lose validation when online and IDE editing support).
> Perhaps each Doxia parser should have some embedded schemas (for FML, at least http://maven.apache.org/FML/1.0.1) so the entities can be resolved locally.
> Or at least a property for disabling document validation.
> I don't think v2.1 can be released with this issue unresolved.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira