[ 
https://jira.codehaus.org/browse/MOJO-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=287363#comment-287363
 ] 

Nickolay Martinov commented on MOJO-1438:
-----------------------------------------

Test fails if there is no Internet connection available because test tries to 
validate catalog file too. This can be easily fixed by excluding catalog file 
from the validation set.

{{
Parse catalog: 
/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml
Loading catalog: 
/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml
Default BASE: 
file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml
public: -COUNTER-DTD-
        ../dtd/sample.dtd
PUBLIC: -COUNTER-DTD-
        
file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/dtd/sample.dtd
public: --COUNTER--
        ../xsd/schema.xsd
PUBLIC: --COUNTER--
        
file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xsd/schema.xsd
[DEBUG] Loading schema with public Id --COUNTER--, system Id null
resolvePublic(--COUNTER--,null)
Resolved public: --COUNTER--
        
file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xsd/schema.xsd
[DEBUG] Validating 
/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/doc1.xml
resolveSystem(http://www.example.com/sample.dtd)
resolvePublic(-COUNTER-DTD-,http://www.example.com/sample.dtd)
Resolved public: -COUNTER-DTD-
        
file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/dtd/sample.dtd
[DEBUG] Validating 
/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml
resolveSystem(http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd)
resolvePublic(-//OASIS/DTD Entity Resolution XML Catalog 
V1.0//EN,http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd)
resolveSystem(http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd)
[DEBUG] URLResourceLoader: Exception when looking for 
'http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd
java.io.IOException: Server returned HTTP response code: 503 for URL: 
http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
        at java.net.URL.openStream(URL.java:1010)
        at 
org.codehaus.plexus.resource.loader.URLResourceLoader.getResource(URLResourceLoader.java:125)
        at 
org.codehaus.plexus.resource.DefaultResourceManager.getResource(DefaultResourceManager.java:159)
        at org.codehaus.mojo.xml.Resolver.resolve(Resolver.java:335)
        at org.codehaus.mojo.xml.Resolver.resolveResource(Resolver.java:213)
        at 
org.apache.xerces.util.DOMEntityResolverWrapper.resolveEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
        at 
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.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.jaxp.validation.StreamValidatorHelper.validate(Unknown Source)
        at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown 
Source)
        at javax.xml.validation.Validator.validate(Validator.java:127)
        at org.codehaus.mojo.xml.ValidateMojo.validate(ValidateMojo.java:174)
        at org.codehaus.mojo.xml.ValidateMojo.validate(ValidateMojo.java:337)
        at org.codehaus.mojo.xml.ValidateMojo.execute(ValidateMojo.java:362)
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at 
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[DEBUG] The resource 
'http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd' was not 
found with resourceLoader org.codehaus.plexus.resource.loader.URLResourceLoader.
[DEBUG] The resource 
'http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd' was not 
found with resourceLoader org.codehaus.plexus.resource.loader.JarResourceLoader.
[DEBUG] The resource 
'http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd' was not 
found with resourceLoader 
org.codehaus.plexus.resource.loader.FileResourceLoader.
[DEBUG] The resource 
'http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd' was not 
found with resourceLoader 
org.codehaus.plexus.resource.loader.ThreadContextClasspathResourceLoader.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:35.604s
[INFO] Finished at: Wed Jan 04 11:45:50 MSK 2012
[INFO] Final Memory: 4M/249M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.codehaus.mojo:xml-maven-plugin:1.0-nom:validate (default) on project it11: 
While parsing 
/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml:
 Unable to resolve: pType=http://www.w3.org/TR/REC-xml pNamespaceURI=null 
pPublicId=-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN 
pSystemId=http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd 
pBaseURI=file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml
 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.codehaus.mojo:xml-maven-plugin:1.0-nom:validate (default) on project it11: 
While parsing 
/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml:
 Unable to resolve: pType=http://www.w3.org/TR/REC-xml pNamespaceURI=null 
pPublicId=-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN 
pSystemId=http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd 
pBaseURI=file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at 
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: While parsing 
/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml:
 Unable to resolve: pType=http://www.w3.org/TR/REC-xml pNamespaceURI=null 
pPublicId=-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN 
pSystemId=http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd 
pBaseURI=file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml
        at org.codehaus.mojo.xml.ValidateMojo.validate(ValidateMojo.java:226)
        at org.codehaus.mojo.xml.ValidateMojo.validate(ValidateMojo.java:337)
        at org.codehaus.mojo.xml.ValidateMojo.execute(ValidateMojo.java:362)
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.lang.IllegalStateException: Unable to resolve: 
pType=http://www.w3.org/TR/REC-xml pNamespaceURI=null pPublicId=-//OASIS/DTD 
Entity Resolution XML Catalog V1.0//EN 
pSystemId=http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd 
pBaseURI=file:/home/jenkins/ci/slv/workspace/NOM_6_build/build/xml-maven-plugin/target/it/mojo-1438-validate/src/main/xml/catalog.xml
        at org.codehaus.mojo.xml.Resolver.resolveResource(Resolver.java:227)
        at 
org.apache.xerces.util.DOMEntityResolverWrapper.resolveEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
        at 
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.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.jaxp.validation.StreamValidatorHelper.validate(Unknown Source)
        at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown 
Source)
        at javax.xml.validation.Validator.validate(Validator.java:127)
        at org.codehaus.mojo.xml.ValidateMojo.validate(ValidateMojo.java:174)
        ... 23 more
}}

                
> Validate and transform doesn't use resolver to resolve doctype declaration in 
> source files
> ------------------------------------------------------------------------------------------
>
>                 Key: MOJO-1438
>                 URL: https://jira.codehaus.org/browse/MOJO-1438
>             Project: Mojo
>          Issue Type: Bug
>          Components: xml
>            Reporter: Nick Stolwijk
>            Assignee: Robert Scholte
>         Attachments: mojo-1438-validate-fix-catalog-validation.patch, 
> resolver.patch
>
>
> When your source file contains a doctype declaration, the catalog is not used 
> to resolve these declarations.
> ie. the next file cannot be read, as the dtd can not be found, although I 
> specified a local dtd for the -COUNTER-DTD- in the catalog.
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE DOC PUBLIC "-COUNTER-DTD-" "http://www.example.com/sample.dtd";>
> <DOC xmlns="xyz0"><HEADER>A sample document.</HEADER></DOC>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to