Maven 2.x and 3.x Site Plugin

Site generation fails if unable to retrieve schema (in offline mode)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.1
  • Fix Version/s: 2.1.1
  • Component/s: doxia integration
  • Labels:
    None
  • Environment:
    Maven 2.2.1
    Site Plugin 2.1-SNAPSHOT
    Doxia 1.1.2
  • Number of attachments :
    0

Description

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.

Issue Links

Activity

Hide
Dave Meibusch added a comment -

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

Show
Dave Meibusch added a comment - Confirmed that this is an issue with the Site Plugin 2.1 release (prev. testing was with 2.1-SNAPSHOT).
Hide
Marcel May added a comment -

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

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

The build finally fails with:

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
Show
Marcel May added a comment - 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
"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)
The build finally fails with:
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
Hide
Mike Hanafey added a comment -

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.

<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
Show
Mike Hanafey added a comment - 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.
<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
Hide
Ben Leedham added a comment - - edited

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:

AbstractXmlParsers.java
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.

Show
Ben Leedham added a comment - - edited 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:
AbstractXmlParsers.java
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.
Hide
Peter Runge added a comment -

This problem was holding me up, but I found a workaround. Since AbstractXmlParser's validate() 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.:

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

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

Show
Peter Runge added a comment - This problem was holding me up, but I found a workaround. Since AbstractXmlParser's validate() 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.:
 
<?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>
This way Maven builds the site or PDF without validation but I still get full XML validation and auto-completion in my XML editor.
Hide
Lukas Theussl added a comment -

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.

Show
Lukas Theussl added a comment - 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.
Hide
Bruno Marti added a comment -

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

Show
Bruno Marti added a comment - I've tested with 2.1.1-SNAPSHOT No more validation exceptions. Will the fix be added to the next release?
Hide
Lukas Theussl added a comment -

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.

Show
Lukas Theussl added a comment - 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.

People

Vote (7)
Watch (8)

Dates

  • Created:
    Updated:
    Resolved: