You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Steven E. Harris (JIRA)" <ji...@apache.org> on 2007/05/18 22:19:16 UTC

[jira] Created: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
--------------------------------------------------------------------------------------------------------------

                 Key: CXF-662
                 URL: https://issues.apache.org/jira/browse/CXF-662
             Project: CXF
          Issue Type: Improvement
          Components: WS-* Components
    Affects Versions: 2.1
         Environment: NA
            Reporter: Steven E. Harris


Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for

  http://www.w3.org/2006/07/ws-policy

When I mention this schema in my cxf.xml file like the following except, I see the error that follows:

   <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
   <wsp:Policy wsu:Id="addressingPolicy"
               xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
               xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
      <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
                       wsp:Optional="true">
         <wsp:Policy/>
      </wsam:Addressing>
   </wsp:Policy>


Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
	... 26 more


If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:

   <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
   <wsp:Policy wsu:Id="addressingPolicy"
               xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
               xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
               xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
      <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
                       wsp:Optional="true">
         <wsp:Policy/>
      </wsam:Addressing>
   </wsp:Policy>


However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.

Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Steven E. Harris (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498778 ] 

Steven E. Harris commented on CXF-662:
--------------------------------------

I noticed that in the test added for this issue, the file "spring/server.xml" contains use of this WS-Policy namespace, but it also includes a schemaLocation declaration. My question in the original issue description asks whether we need to specify the schemaLocation in our cxf.xml file; the test file "spring/server.xml" suggests that we still do need this declaration.

Is the point here that the spring.schemas file specifies a mapping not from namespaces to local files, but from schemaLocation URIs to local files? If so, why not just establish a namespace-to-local file mapping, rather than trying to intercept requests to the schemaLocation URIs?

> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>         Assigned To: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Andrea Smyth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Smyth resolved CXF-662.
------------------------------

    Resolution: Fixed

> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>         Assigned To: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Andrea Smyth (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498790 ] 

Andrea Smyth commented on CXF-662:
----------------------------------


Yes, see 
http://static.springframework.org/spring/docs/2.1.x/reference/extensible-xml.html#extensible-xml-registration-spring-schemas.
 I did not actually add a new test case for this issue but enabled 
schema validation for the cxf-rt-ws-policy module, and hence the bus 
used in PolicyFeatureTest.

Not sure if Spring allows us to change this for the Bus application 
context.




> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>         Assigned To: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Andrea Smyth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Smyth closed CXF-662.
----------------------------

    Resolution: Fixed

> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>            Assignee: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Steven E. Harris (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497886 ] 

Steven E. Harris commented on CXF-662:
--------------------------------------

I tried to test the changes this morning, but it looks like they haven't propagated out to the nightly Maven-published builds, but thank you for now for fixing this problem. I'll try again tomorrow and report back if I still encounter trouble.

> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>         Assigned To: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Steven E. Harris (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498292 ] 

Steven E. Harris commented on CXF-662:
--------------------------------------

I tried again this morning (23 May) with new CXF artifacts, still to no avail. The schemaLocation attribute is still required, so I'm suspecting that these changes are not yet available in the Maven 2.0-incubator-SNAPSHOT builds.

> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>         Assigned To: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Andrea Smyth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Smyth reassigned CXF-662:
--------------------------------

    Assignee: Andrea Smyth

> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>         Assigned To: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Steven E. Harris (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven E. Harris reopened CXF-662:
----------------------------------


As of 24 May, using the Maven-published 2.0-incubator-SNAPSHOT artifacts, I'm still seeing the same error as originally reported. If this issue has been fixed, how can I get a built artifact that contains the changes?

> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>         Assigned To: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-662) Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them

Posted by "Steven E. Harris (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498794 ] 

Steven E. Harris commented on CXF-662:
--------------------------------------

Thanks for the reference, Andrea. I also read the discussion on Spring's PluggableSchemaResolver after posting my comment:

  http://www.springframework.org/docs/api/org/springframework/beans/factory/xml/PluggableSchemaResolver.html

It's a weird design, hooking system IDs like that, but I guess that's how the EntityResolver interface works. I put the schemaLocation attribute back into my cxf.xml file and it works as intended. I'll just have to trust it's not going to start trying to download the schema for the W3C site.

I don't quite understand your comment about validation. Do you mean that validation is enabled for the test, but not for the rest of the XML parsing done by the Bus application context?

In any case, we can close this issue (again). Thanks for following up.

> Make schema for WS-Policy (and related schemas) available to Spring's validating parser to preclude fetch them
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-662
>                 URL: https://issues.apache.org/jira/browse/CXF-662
>             Project: CXF
>          Issue Type: Improvement
>          Components: WS-* Components
>    Affects Versions: 2.1
>         Environment: NA
>            Reporter: Steven E. Harris
>         Assigned To: Andrea Smyth
>
> Even though the WS-Policy schema are present in cxf-rt-ws-policy module under the "schema" directory, it seems that Spring's XML parser doesn't find the schema for
>   http://www.w3.org/2006/07/ws-policy
> When I mention this schema in my cxf.xml file like the following except, I see the error that follows:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wsp:Policy'.
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1898)
> 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2740)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
> 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
> 	... 26 more
> If I include an explicit schemaLocation declaration for this namespace like the following, no error arises:
>    <!-- TODO: Watch for migration of wsam referring to http://www.w3.org/ns/ws-policy. -->
>    <wsp:Policy wsu:Id="addressingPolicy"
>                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>                xmlns:wsp="http://www.w3.org/2006/07/ws-policy">
>                xsi:schemaLocation="http://www.w3.org/2006/07/ws-policy http://www.w3.org/2006/11/ws-policy.xsd">
>       <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"
>                        wsp:Optional="true">
>          <wsp:Policy/>
>       </wsam:Addressing>
>    </wsp:Policy>
> However, in this latter case, the XML parser fetches the schema from the supplied URL ovre the network -- or at least it seems to, as it takes a lot longer to process the wsp:Policy element.
> Should I really need this schemaLocation attribute? If the schema is shipped with the cxf-rt-ws-policy module, shouldn't it be found by the XML parser?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.