You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dave Meibusch (JIRA)" <ji...@codehaus.org> on 2009/12/11 02:55:55 UTC

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

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


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

        

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

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukas Theussl closed MSITE-440.
-------------------------------

    Resolution: Fixed
      Assignee: Lukas Theussl

I consider this fixed with MSITE-474 since no more exception occurs. Current drawback is that validation is not possible in off-line mode, but that's another issue.

> 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
>            Assignee: Lukas Theussl
>            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

        

[jira] Updated: (MSITE-440) Site generation fails if unable to retrieve schema (in offline mode)

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukas Theussl updated MSITE-440:
--------------------------------

    Summary: Site generation fails if unable to retrieve schema (in offline mode)  (was: Site document validation fails if unable to retrieve schema (in offline mode))

> Site generation 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
>            Assignee: Lukas Theussl
>            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

        

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

Posted by "Mike Hanafey (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=209083#action_209083 ] 

Mike Hanafey commented on MSITE-440:
------------------------------------

The problem exists even when not in offline mode if you require a proxy to fetch external resources. The root cause in this case is *java.net.UnknownHostException: maven.apache.org*. 

I stored a local copy of the FML schema, but then the same error occurs on some reference to www.w3.org. So the problem is the proxy configuration from settings.xml is not being used.

{code}<faqs
  xmlns="http://maven.apache.org/FML/1.0.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 http://maven.apache.org/xsd/fml-1.0.1.xsd"
  title="">
...
</faqs>

[DEBUG] Generating /home/mkh/sd/svn/LeadTracker/trunk/DB/target/site/conventions.html
[DEBUG] Validating the content...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error during page generation

Embedded error: Error parsing '/home/mkh/sd/svn/LeadTracker/trunk/DB/src/site/fml/conventions.fml': line [-1] Error validating the model: maven.apache.org
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error during page generation
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
	at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error during page generation
	at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:114)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
	... 22 more
Caused by: org.apache.maven.doxia.siterenderer.RendererException: Error parsing '/home/mkh/sd/svn/LeadTracker/trunk/DB/src/site/fml/conventions.fml': line [-1] Error validating the model: maven.apache.org
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderDocument(DefaultSiteRenderer.java:412)
	at org.apache.maven.doxia.siterenderer.DoxiaDocumentRenderer.renderDocument(DoxiaDocumentRenderer.java:53)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:328)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:132)
	at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:142)
	at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:109)
	... 24 more
Caused by: org.apache.maven.doxia.parser.ParseException: Error validating the model: maven.apache.org
	at org.apache.maven.doxia.parser.AbstractXmlParser.validate(AbstractXmlParser.java:640)
	at org.apache.maven.doxia.parser.AbstractXmlParser.parse(AbstractXmlParser.java:142)
	at org.apache.maven.doxia.module.fml.FmlParser.parse(FmlParser.java:122)
	at org.apache.maven.doxia.DefaultDoxia.parse(DefaultDoxia.java:63)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderDocument(DefaultSiteRenderer.java:404)
	... 29 more
Caused by: java.net.UnknownHostException: maven.apache.org
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:525)
	at java.net.Socket.connect(Socket.java:475)
	at java.net.Socket.<init>(Socket.java:372)
	at java.net.Socket.<init>(Socket.java:246)
	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
	at org.apache.maven.doxia.parser.AbstractXmlParser$CachedFileEntityResolver.toByteArray(AbstractXmlParser.java:1024)
	at org.apache.maven.doxia.parser.AbstractXmlParser$CachedFileEntityResolver.resolveEntity(AbstractXmlParser.java:958)
	at org.apache.xerces.util.EntityResolverWrapper.resolveEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.maven.doxia.parser.AbstractXmlParser.validate(AbstractXmlParser.java:635)
	... 33 more

{code}

> 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

        

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

Posted by "Ben Leedham (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=218340#action_218340 ] 

Ben Leedham edited comment on MSITE-440 at 4/20/10 8:54 AM:
------------------------------------------------------------

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:
{code:title=AbstractXmlParsers.java|borderStyle=solid}
            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 );
{code}
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.

      was (Author: ben_leedham):
    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

        

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

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=221005#action_221005 ] 

Lukas Theussl commented on MSITE-440:
-------------------------------------

I have deployed site-plugin-2.1.1-SNAPSHOT that includes MSITE-474, please test if that helps anybody here. It doesn't really fix this issue (see DOXIA-388) but it provides a more coherent workaround.

> 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

        

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

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukas Theussl updated MSITE-440:
--------------------------------

    Fix Version/s: 2.1.1

> 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

        

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

Posted by "Bruno Marti (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222580#action_222580 ] 

Bruno Marti commented on MSITE-440:
-----------------------------------

I've tested with 2.1.1-SNAPSHOT
No more validation exceptions. Will the fix be added to the next release?

> 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

        

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

Posted by "Dave Meibusch (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=203893#action_203893 ] 

Dave Meibusch commented on MSITE-440:
-------------------------------------

Confirmed that this is an issue with the Site Plugin 2.1 release (prev. testing was with 2.1-SNAPSHOT).


> 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
>
> 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

        

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

Posted by "Ben Leedham (JIRA)" <ji...@codehaus.org>.
    [ 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

        

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

Posted by "Marcel May (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=203925#action_203925 ] 

Marcel May commented on MSITE-440:
----------------------------------

Here's a thread stack for the hanging connection confirming Dave.

Anyone using schemas - eg for xdoc - should skip version 2.1 of the plugin - wish I'd tested when the voting was going on :-(

{code}
"main" prio=10 tid=0x000000004129a000 nid=0x71a3 runnable [0x00007f65375a5000]
   java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        - locked <0x00007f6525eba068> (a java.net.SocksSocketImpl)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:525)
        at java.net.Socket.connect(Socket.java:475)
        at java.net.Socket.<init>(Socket.java:372)
        at java.net.Socket.<init>(Socket.java:246)
        at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
        at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
        at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.apache.maven.doxia.parser.AbstractXmlParser$CachedFileEntityResolver.toByteArray(AbstractXmlParser.java:1024)
        at org.apache.maven.doxia.parser.AbstractXmlParser$CachedFileEntityResolver.resolveEntity(AbstractXmlParser.java:958)
        at org.apache.xerces.util.EntityResolverWrapper.resolveEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.maven.doxia.parser.AbstractXmlParser.validate(AbstractXmlParser.java:635)
        at org.apache.maven.doxia.parser.AbstractXmlParser.parse(AbstractXmlParser.java:142)
        at org.apache.maven.doxia.parser.XhtmlBaseParser.parse(XhtmlBaseParser.java:90)
        at org.apache.maven.doxia.module.xdoc.XdocParser.parse(XdocParser.java:104)
        at org.apache.maven.doxia.DefaultDoxia.parse(DefaultDoxia.java:63)
        at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderDocument(DefaultSiteRenderer.java:404)
        at org.apache.maven.doxia.siterenderer.DoxiaDocumentRenderer.renderDocument(DoxiaDocumentRenderer.java:53)
        at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:328)
        at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:132)
        at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:142)
        at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:109)
{code}

The build finally fails with:

{code}
Dec 23, 2009 11:06:15 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
Dec 23, 2009 11:06:15 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Dec 23, 2009 11:09:24 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
Dec 23, 2009 11:09:24 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error during page generation

Embedded error: Error parsing '/home/mm/myproject/trunk/src/site/xdoc/quickstart.xml': line [-1] Error validating the model: Connection timed out
{code}


> 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

        

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

Posted by "Peter Runge (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=219785#action_219785 ] 

Peter Runge commented on MSITE-440:
-----------------------------------

This problem was holding me up, but I found a workaround.  Since [AbstractXmlParser's validate()|https://maven.apache.org/doxia/doxia/doxia-core/xref/org/apache/maven/doxia/parser/AbstractXmlParser.html#611] method uses simple pattern matching for finding whether an XML schema is used in an XML file, I tricked it into thinking there was no XML schema for a file by putting a comment before the main root element, e.g.:

{noformat} 
<?xml version="1.0" encoding="UTF-8"?>
<!-- 
Fool Maven's validator:
(see http://jira.codehaus.org/browse/MSITE-440)
<document blah="true">
</document>
-->
<document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd"
    xmlns="http://maven.apache.org/XDOC/2.0">
    
    <body>
        <section name="Introduction">
            <p>
                ...
            </p>  
        </section>
    </body>
</document>
{noformat}

This way Maven builds the site or PDF without validation but I still get full XML validation and auto-completion in my XML editor.

> 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