You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Patrick Leamon (JIRA)" <ji...@apache.org> on 2010/10/27 06:06:23 UTC

[jira] Created: (CXF-3095) Jax WS - Schema validation fails after 5th request

Jax WS - Schema validation fails after 5th request
--------------------------------------------------

                 Key: CXF-3095
                 URL: https://issues.apache.org/jira/browse/CXF-3095
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.2.10
         Environment: running in tomcat 6
            Reporter: Patrick Leamon


I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.

The beans.xml I'm using to configure the web service looks something like:
{code:xml}
    <jaxws:endpoint id="LocationServiceId"
                    implementor="com.blah.LocationServiceImpl"
                    address="/services/location">
        <jaxws:properties>
            <entry key="schema-validation-enabled" value="true" />
        </jaxws:properties>
        <jaxws:schemaLocations>
            <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
            <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
            <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
        </jaxws:schemaLocations>
    </jaxws:endpoint>
{code}

The first five requests that I send to this web service function correctly.  Any further requests result in:
Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'

Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.

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


[jira] Commented: (CXF-3095) Jax WS - Schema validation fails after 5th request

Posted by "Patrick Leamon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925609#action_12925609 ] 

Patrick Leamon commented on CXF-3095:
-------------------------------------

I think I've figured out the difference.  In 2.0.11 the provided schema's (via schemaLocations) were being used as base schemas.  In 2.2.10 and 2.2.11 it is using schemas generated from the jaxb classes and javax.jws annotated classes only.

Looking at the wsdl, these are slightly different.  The xsd's we have are something like:
{code:xml}
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://example.com/location-service" xmlns:com="http://example.com/common-types" xmlns:util="http://example.com/location-types" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://example.com/location-service">
    <xs:annotation>
        <xs:documentation>
				Bare Elements
			</xs:documentation>
    </xs:annotation>
    <xs:import namespace="http://example.com/common-types"/>
    <xs:import namespace="http://example.com/location-types"/>

    <xs:element name="serviceFault" type="com:ServiceFault"/>
    .... etc ....
{code}

So our wsdl in 2.0.11 has this included.  In 2.2.10 + 2.2.11 this seems to be ignored and we get something like this:
{code:xml}
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://example.com/common-types" xmlns:ns1="http://example.com/location-types" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://example.com/location-service">
    <xs:import namespace="http://example.com/location-types"/>

    <xs:element name="serviceFault" type="ns0:ServiceFault"/>
    .... etc ....
{code}

instead.  Note that in the schema for 'http://example.com/location-types' there is an import for 'http://example.com/common-types'

Why the change?  Is this related to the problem I'm seeing or just a side effect.

> Jax WS - Schema validation fails after 5th request
> --------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.

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


[jira] Updated: (CXF-3095) test to verify multiple xsd files work with schema-validation-enabled

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

Freeman Fang updated CXF-3095:
------------------------------

    Fix Version/s:     (was: NeedMoreInfo)
                   2.4
                   2.2.13
                   2.3.2
       Issue Type: Test  (was: Bug)
          Summary: test to verify multiple xsd files work with schema-validation-enabled  (was: Jax WS - Schema Locations are ignored since CXF-2851 was implemented)

change this issue title and type as it's not a bug, the problem comes from  that misuse import and include for external xsd files.

Committed systest to demonstrate the correct usage

> test to verify multiple xsd files work with schema-validation-enabled
> ---------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Test
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: 2.3.2, 2.2.13, 2.4
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jason Mihalick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966735#action_12966735 ] 

Jason Mihalick commented on CXF-3095:
-------------------------------------

Hold on my last comment.  I realized that I have a configuration problem in my environment.  I am in the middle of a large refactor so I should now soon whether or not there is a problem.  I will post another comment once I know and will withdraw my comment if appropriate.  Thanks.

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>             Fix For: NeedMoreInfo
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Issue Comment Edited: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jason Mihalick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966587#action_12966587 ] 

Jason Mihalick edited comment on CXF-3095 at 12/3/10 12:11 PM:
---------------------------------------------------------------

I am having a similar problem to this.  I have the WSDL (pertinent portions included below), which I initially generated using CXF tools, but have modified  to make it more modular.  The WSDL has several imports to import schemas from the root of my webapp.  The WSDL validates fine using oXygen WSDL validation tools.  My service works just fine as well so long as I do not turn on validation.  Under CXF 2.2.6 I was unable to get validation to turn on using the jaxws property {{schema-validation-enabled}}, so I upgraded to CXF 2.3.0 to see if the {{@SchemaValidation}} annotation would work.  It did!  However, I immediately starting getting Xerces {{SaxParseExceptions}} (also included below) which said it could not find the declaration of elements and that it could not resolve some names.  I then discovered the {{<jaxws:schemaLocation>}} configuration and added my schemas.  It made no difference.  I set a breakpoint on {{com.sun.org.apache.xerces.internal.jaxp.XMLSchemaFactory}} (line 210, {{fXMLSchemaLoader.loadGrammar(xmlInputSources);}}) and noticed that the WSDL is the only file resource being supplied to the SchemaLoader.  What other things can I try?  Is this the same problem?  I tried downgrading to CXF 2.2.9 and I'm back to my original problem under 2.2.6, which is that I am unable to get validation to turn on using the {{schema-validation-enabled}}.
\\
\\
{code:xml|title=WSDL}
<wsdl:definitions
  name="EvaluatorService"
  targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:tns="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:ereq="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:eresp="http://my.company.org/wsdl/jca/EvaluatorService"
  >
 
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorRequest.xsd"/>
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorResponse.xsd"/>
  <!--
  **************************************************************************
  WSDL Types
  ************************************************************************** -->
  <wsdl:types>
    <xs:schema elementFormDefault="qualified"
      targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
      version="1.0">
     
      <xs:element name="evaluate">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" ref="ereq:eval-request"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
 
      <xs:element name="eval-response" type="tns:eval-response"/>
     
      <xs:complexType name="eval-response">
        <xs:sequence>
          <xs:element minOccurs="0"  ref="eresp:document-eval-result"/>
        </xs:sequence>
      </xs:complexType>
     
    </xs:schema>
  </wsdl:types>

8<--------------- snip 8< -----------------------
{code}

{code:title=MyServiceImpl.java}
@WebService(
    endpointInterface = "org.my.company.jca.evaluator.service.EvaluatorService",
      targetNamespace = "http://my.company.org/wsdl/jca/EvaluatorService",  
         wsdlLocation = "EvaluatorService.wsdl"
)
@SchemaValidation(enabled=true)

8<--------------- snip 8< -----------------------
{code}

{code:xml|title=Spring Configuration}
8<--------------- snip 8< -----------------------

  <!--
  **************************************************************************
  JAX-WS web services, provided via Apache CXF
  ************************************************************************** -->
  <bean id="evaluatorServiceImpl" class="org.my.company.jca.evaluator.service.EvaluatorServiceImpl"/>
 
  <!-- Webservice endpoint configuration -->
  <jaxws:endpoint
    id="evaluator"
    implementor="#evaluatorServiceImpl"
    address="/evaluatorService"
    xmlns:s="http://my.company.org/wsdl/jca/EvaluatorService"
    serviceName="s:EvaluatorService"
    wsdlLocation="EvaluatorService.wsdl" >
    <jaxws:schemaLocations>
      <jaxws:schemaLocation>classpath:EvaluatorRequest.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorDocument.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorResponse.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorTypes.xsd</jaxws:schemaLocation>
    </jaxws:schemaLocations>
    <jaxws:features>
      <bean class="org.apache.cxf.feature.LoggingFeature"/>
    </jaxws:features>
    <jaxws:properties>
      <entry key="schema-validation-enabled" value="true" />
    </jaxws:properties>   
  </jaxws:endpoint>

8<--------------- snip 8< -----------------------
{code}

{code:title=Exceptions}
WARNING: SAXException for newSchema()
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'ereq:eval-request' to a(n) 'element declaration' component.

WARNING: Interceptor for {http://my.company.org/wsdl/jca/EvaluatorService}EvaluatorService#{http://my.company.org/wsdl/jca/EvaluatorService}evaluate has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns2:eval-response'.
{code}



      was (Author: jrmihalick):
    I am having a similar problem to this.  I have the WSDL (pertinent portions included below), which I initially generated using CXF tools, but have modified  to make it more modular.  The WSDL has several imports to import schemas from the root of my webapp.  The WSDL validates fine using oXygen WSDL validation tools.  My service works just fine as well so long as I do not turn on validation.  Under CXF 2.2.6 I was unable to get validation to turn on using the jaxws property {{schema-validation-enabled}}, so I upgraded to CXF 2.3.0 to see if the {{@SchemaValidation}} annotation would work.  It did!  However, I immediately starting getting Xerces {{SaxParseExceptions}} (also included below) which said it could not find the declaration of elements and that it could not resolve some names.  I then discovered the {{<jaxws:schemaLocation>}} configuration and added my schemas.  It made no difference.  I set a breakpoint on {{com.sun.org.apache.xerces.internal.jaxp.XMLSchemaFactory}} (line 210, {{fXMLSchemaLoader.loadGrammar(xmlInputSources);}}) and noticed that the WSDL is the only file resource being supplied to the SchemaLoader.  What other things can I try?  Is this the same problem?  I tried downgrading to CXF 2.2.9 and I'm back to my original problem under 2.2.6, which is that I am unable to get validation to turn on using the {{schema-validation-enabled}}.
\\
\\
{code:xml|title=WSDL}
<wsdl:definitions
  name="EvaluatorService"
  targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:tns="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:ereq="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:eresp="http://my.company.org/wsdl/jca/EvaluatorService"
  >
 
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorRequest.xsd"/>
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorResponse.xsd"/>
  <!--
  **************************************************************************
  WSDL Types
  ************************************************************************** -->
  <wsdl:types>
    <xs:schema elementFormDefault="qualified"
      targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
      version="1.0">
     
      <xs:element name="evaluate">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" ref="ereq:eval-request"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
 
      <xs:element name="eval-response" type="tns:eval-response"/>
     
      <xs:complexType name="eval-response">
        <xs:sequence>
          <xs:element minOccurs="0"  ref="eresp:document-eval-result"/>
        </xs:sequence>
      </xs:complexType>
     
    </xs:schema>
  </wsdl:types>
{code}

{code:title=MyServiceImpl.java}
@WebService(
    endpointInterface = "org.my.company.jca.evaluator.service.EvaluatorService",
      targetNamespace = "http://my.company.org/wsdl/jca/EvaluatorService",  
         wsdlLocation = "EvaluatorService.wsdl"
)
@SchemaValidation(enabled=true)
{code}

{code:xml|title=Spring Configuration}
  <!--
  **************************************************************************
  JAX-WS web services, provided via Apache CXF
  ************************************************************************** -->
  <bean id="evaluatorServiceImpl" class="org.my.company.jca.evaluator.service.EvaluatorServiceImpl"/>
 
  <!-- Webservice endpoint configuration -->
  <jaxws:endpoint
    id="evaluator"
    implementor="#evaluatorServiceImpl"
    address="/evaluatorService"
    xmlns:s="http://my.company.org/wsdl/jca/EvaluatorService"
    serviceName="s:EvaluatorService"
    wsdlLocation="EvaluatorService.wsdl" >
    <jaxws:schemaLocations>
      <jaxws:schemaLocation>classpath:EvaluatorRequest.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorDocument.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorResponse.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorTypes.xsd</jaxws:schemaLocation>
    </jaxws:schemaLocations>
    <jaxws:features>
      <bean class="org.apache.cxf.feature.LoggingFeature"/>
    </jaxws:features>
    <jaxws:properties>
      <entry key="schema-validation-enabled" value="true" />
    </jaxws:properties>   
  </jaxws:endpoint>
{code}

{code:title=Exceptions}
WARNING: SAXException for newSchema()
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'ereq:eval-request' to a(n) 'element declaration' component.

WARNING: Interceptor for {http://my.company.org/wsdl/jca/EvaluatorService}EvaluatorService#{http://my.company.org/wsdl/jca/EvaluatorService}evaluate has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns2:eval-response'.
{code}


  
> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>             Fix For: NeedMoreInfo
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969771#action_12969771 ] 

Daniel Kulp commented on CXF-3095:
----------------------------------


Yes, import DOES work, but you can only have a single "xsd" per namespace if you use imports.   That's really per spec.

If you have something that isn't working that matches that, we would need a test case that really shows the problem. 

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema validation fails after 5th request

Posted by "Patrick Leamon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925644#action_12925644 ] 

Patrick Leamon commented on CXF-3095:
-------------------------------------

Ignoring the specified schema's seems to be due to 	the changes in CXF-2851.  The code that used to load the schemas is now in a path that is never called (unless there is something reflectively calling AbstractServiceFactoryBean.initializeDataBindings() ).  Going back to 2.2.9 fixes this issue.

> Jax WS - Schema validation fails after 5th request
> --------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jason Mihalick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966587#action_12966587 ] 

Jason Mihalick commented on CXF-3095:
-------------------------------------

I am having a similar problem to this.  I have the WSDL (pertinent portions included below), which I initially generated using CXF tools, but have modified  to make it more modular.  The WSDL has several imports to import schemas from the root of my webapp.  The WSDL validates fine using oXygen WSDL validation tools.  My service works just fine as well so long as I do not turn on validation.  Under CXF 2.2.6 I was unable to get validation to turn on using the jaxws property {{schema-validation-enabled}}, so I upgraded to CXF 2.3.0 to see if the {{@SchemaValidation}} annotation would work.  It did!  However, I immediately starting getting Xerces {{SaxParseExceptions}} (also included below) which said it could not find the declaration of elements and that it could not resolve some names.  I then discovered the {{<jaxws:schemaLocation>}} configuration and added my schemas.  It made no difference.  I set a breakpoint on {{com.sun.org.apache.xerces.internal.jaxp.XMLSchemaFactory}} (line 210, {{fXMLSchemaLoader.loadGrammar(xmlInputSources);}}) and noticed that the WSDL is the only file resource being supplied to the SchemaLoader.  What other things can I try?  Is this the same problem?  I tried downgrading to CXF 2.2.9 and I'm back to my original problem under 2.2.6, which is that I am unable to get validation to turn on using the {{schema-validation-enabled}}.
\\
\\
{code:xml|title=WSDL}
<wsdl:definitions
  name="EvaluatorService"
  targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:tns="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:ereq="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:eresp="http://my.company.org/wsdl/jca/EvaluatorService"
  >
 
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorRequest.xsd"/>
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorResponse.xsd"/>
  <!--
  **************************************************************************
  WSDL Types
  ************************************************************************** -->
  <wsdl:types>
    <xs:schema elementFormDefault="qualified"
      targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
      version="1.0">
     
      <xs:element name="evaluate">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" ref="ereq:eval-request"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
 
      <xs:element name="eval-response" type="tns:eval-response"/>
     
      <xs:complexType name="eval-response">
        <xs:sequence>
          <xs:element minOccurs="0"  ref="eresp:document-eval-result"/>
        </xs:sequence>
      </xs:complexType>
     
    </xs:schema>
  </wsdl:types>
{code}

{code:title=MyServiceImpl.java}
@WebService(
    endpointInterface = "org.my.company.jca.evaluator.service.EvaluatorService",
      targetNamespace = "http://my.company.org/wsdl/jca/EvaluatorService",  
         wsdlLocation = "EvaluatorService.wsdl"
)
@SchemaValidation(enabled=true)
{code}

{code:xml|title=Spring Configuration}
  <!--
  **************************************************************************
  JAX-WS web services, provided via Apache CXF
  ************************************************************************** -->
  <bean id="evaluatorServiceImpl" class="org.my.company.jca.evaluator.service.EvaluatorServiceImpl"/>
 
  <!-- Webservice endpoint configuration -->
  <jaxws:endpoint
    id="evaluator"
    implementor="#evaluatorServiceImpl"
    address="/evaluatorService"
    xmlns:s="http://my.company.org/wsdl/jca/EvaluatorService"
    serviceName="s:EvaluatorService"
    wsdlLocation="EvaluatorService.wsdl" >
    <jaxws:schemaLocations>
      <jaxws:schemaLocation>classpath:EvaluatorRequest.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorDocument.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorResponse.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorTypes.xsd</jaxws:schemaLocation>
    </jaxws:schemaLocations>
    <jaxws:features>
      <bean class="org.apache.cxf.feature.LoggingFeature"/>
    </jaxws:features>
    <jaxws:properties>
      <entry key="schema-validation-enabled" value="true" />
    </jaxws:properties>   
  </jaxws:endpoint>
{code}

{code:title=Exceptions}
WARNING: SAXException for newSchema()
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'ereq:eval-request' to a(n) 'element declaration' component.

WARNING: Interceptor for {http://my.company.org/wsdl/jca/EvaluatorService}EvaluatorService#{http://my.company.org/wsdl/jca/EvaluatorService}evaluate has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns2:eval-response'.
{code}



> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>             Fix For: NeedMoreInfo
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Updated: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

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

Jean-Claude Souvignet updated CXF-3095:
---------------------------------------

    Attachment: wsVal.zip

wsVal.zip maven project that iluustrate this issue

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Updated: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

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

Daniel Kulp updated CXF-3095:
-----------------------------

    Fix Version/s: NeedMoreInfo


I would need a test case for this.  I checked our test case (rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SchemaFirstXmlConfigTest.java) and it is loading the schemas fine and including them into the wsdl as is.  

HOWEVER, if your service doesn't correctly match the wsdl (particularly around the wrappers), then we need to modify the schema to include the wrapper types which could result in some loss of information as XmlSchema may lose some things, especially formatting.





> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>             Fix For: NeedMoreInfo
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Issue Comment Edited: (CXF-3095) Jax WS - Schema validation fails after 5th request

Posted by "Patrick Leamon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925264#action_12925264 ] 

Patrick Leamon edited comment on CXF-3095 at 10/27/10 1:52 AM:
---------------------------------------------------------------

After some more testing, it seems that the error in the 6th request is slightly different to the rest.  It complains of a Marshalling error when processing the response.  The remaining requests complain that they can't Unmarshal the request.  

Looks like it has lost the reference to the xsd's for some reason.

Some more information about the setup:
- Type beans are generated in the build from the xsd's with javax.xml.bind.annotation.* annotations
- LocationServiceImpl is a concrete class with a @javax.jws.WebService annotation
- LocationServiceImpl implements a LocationService interface with a @javax.jws.WebService annotation.  It is the interface that has the @SOAPBinding, @WebResult, @WebMethod, etc annotations.
- The wsdl for this service generates fine at any time


      was (Author: pat.leamon):
    After some more testing, it seems that the error in the 6th request is slightly different to the rest.  It complains of a Marshalling error when processing the response.  The remaining requests complain that they can't Unmarshal the request.  

Looks like it has lost the reference to the xsd's for some reason.
  
> Jax WS - Schema validation fails after 5th request
> --------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.

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


[jira] Resolved: (CXF-3095) test to verify multiple xsd files work with schema-validation-enabled

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

Freeman Fang resolved CXF-3095.
-------------------------------

    Resolution: Fixed

> test to verify multiple xsd files work with schema-validation-enabled
> ---------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Test
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: 2.3.2, 2.2.13, 2.4
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema validation fails after 5th request

Posted by "Patrick Leamon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925264#action_12925264 ] 

Patrick Leamon commented on CXF-3095:
-------------------------------------

After some more testing, it seems that the error in the 6th request is slightly different to the rest.  It complains of a Marshalling error when processing the response.  The remaining requests complain that they can't Unmarshal the request.  

Looks like it has lost the reference to the xsd's for some reason.

> Jax WS - Schema validation fails after 5th request
> --------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jason Mihalick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969760#action_12969760 ] 

Jason Mihalick commented on CXF-3095:
-------------------------------------

Freeman, 

My scenario isn't quite the same. Ideally, I would like to have 4 separate namespaces: 

* A namespace for the *service* 
* A namespace for the *request* 
* A namespace for a *document* that I am including in the request 
* A namespace for the *response* 

Because I couldn't get it to work otherwise, I put the *request* and *response* in the same namespace as the service. But, this is not what I really want. 

Does import of namespaces work? 

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12970030#action_12970030 ] 

Freeman Fang commented on CXF-3095:
-----------------------------------

commit testcase
http://svn.apache.org/viewvc?rev=1043875&view=rev for trunk
http://svn.apache.org/viewvc?rev=1044167&view=rev for 2.3 branch
http://svn.apache.org/viewvc?rev=1044183&view=rev for 2.2 branch

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969670#action_12969670 ] 

Freeman Fang commented on CXF-3095:
-----------------------------------

Hi Jean-Claude,

I played with the testcase you append, and found that the problem which cause "Cannot find the declaration of element 'ckReponse'." is actually from your
testcase. As both service-req-10.xsd and service-rep-10.xsd are using same namespace, you should use xsd:include but not xsd:import.
So just change from
<xsd:schema>
 			<xsd:import namespace="http://www.service.fr/service/1/0" schemaLocation="../XSD/service-req-10.xsd"/>			
 			<xsd:import namespace="http://www.service.fr/service/1/0" schemaLocation="../XSD/service-rep-10.xsd"/>
to
<xsd:schema targetNamespace="http://www.service.fr/service/1/0">
 			<xsd:include schemaLocation="../XSD/service-req-10.xsd"/>			
 			<xsd:include schemaLocation="../XSD/service-rep-10.xsd"/>
in your service.wsdl.
And I'm going to commit a testcase which verify multiple xsd files work, you can see the response message declared in another xsd files could be found with schema-validation-enabled

@Jason, I believe the problem you encounter is the same case.



Freeman


> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Assigned: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

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

Freeman Fang reassigned CXF-3095:
---------------------------------

    Assignee: Freeman Fang

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jason Mihalick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969997#action_12969997 ] 

Jason Mihalick commented on CXF-3095:
-------------------------------------

Daniel, thank you!  I put together a full test case and I got it to work!  Imports are working fine!  If you want, I can attach the full test case and you could possibly incorporate it into your sample projects.  It uses Maven, Spring 3.0, CXF 2.3, and jetty.

It's just a simple Hello World web service, with Request, Document (embedded in the request), and Response objects.  All of those with modularized XSDs and a corresponding WSDL, which I first generated and then modified to import the XSDs. 

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jason Mihalick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12968435#action_12968435 ] 

Jason Mihalick commented on CXF-3095:
-------------------------------------

Ok, my earlier comments are still valid.  I have confirmed that my schemas configured under the schemaLocation elements are being picked up because when I change the name of a schema file to something invalid, I get an error from cxf saying "Could not load schema".  So the schemas are being detected, but at runtime when parsing they are not being passed down in to the XMLSchemaFactory.

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Updated: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

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

Patrick Leamon updated CXF-3095:
--------------------------------

          Description: 
I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.

The beans.xml I'm using to configure the web service looks something like:
{code:xml}
    <jaxws:endpoint id="LocationServiceId"
                    implementor="com.blah.LocationServiceImpl"
                    address="/services/location">
        <jaxws:properties>
            <entry key="schema-validation-enabled" value="true" />
        </jaxws:properties>
        <jaxws:schemaLocations>
            <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
            <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
            <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
        </jaxws:schemaLocations>
    </jaxws:endpoint>
{code}

The first five requests that I send to this web service function correctly.  Any further requests result in:
Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'

Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.

*edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

  was:
I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.

The beans.xml I'm using to configure the web service looks something like:
{code:xml}
    <jaxws:endpoint id="LocationServiceId"
                    implementor="com.blah.LocationServiceImpl"
                    address="/services/location">
        <jaxws:properties>
            <entry key="schema-validation-enabled" value="true" />
        </jaxws:properties>
        <jaxws:schemaLocations>
            <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
            <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
            <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
        </jaxws:schemaLocations>
    </jaxws:endpoint>
{code}

The first five requests that I send to this web service function correctly.  Any further requests result in:
Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'

Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.

    Affects Version/s: 2.2.11
              Summary: Jax WS - Schema Locations are ignored since CXF-2851 was implemented  (was: Jax WS - Schema validation fails after 5th request)

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Issue Comment Edited: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jason Mihalick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966587#action_12966587 ] 

Jason Mihalick edited comment on CXF-3095 at 12/3/10 12:13 PM:
---------------------------------------------------------------

I am having a similar problem to this.  I have the WSDL (pertinent portions included below), which I initially generated using CXF tools, but have modified  to make it more modular.  The WSDL has several imports to import schemas from the root of my webapp.  The WSDL validates fine using oXygen WSDL validation tools.  My service works just fine as well so long as I do not turn on validation.  Under CXF 2.2.6 I was unable to get validation to turn on using the jaxws property {{schema-validation-enabled}}, so I upgraded to CXF 2.3.0 to see if the {{@SchemaValidation}} annotation would work.  It did!  However, I immediately starting getting Xerces {{SaxParseExceptions}} (also included below) which said it could not find the declaration of elements and that it could not resolve some names.  I then discovered the {{<jaxws:schemaLocation>}} configuration and added my schemas.  It made no difference.  I set a breakpoint on {{com.sun.org.apache.xerces.internal.jaxp.XMLSchemaFactory}} (line 210, {{fXMLSchemaLoader.loadGrammar(xmlInputSources);}}) and noticed that the WSDL is the only file resource being supplied to the SchemaLoader.  What other things can I try?  Is this the same problem?  I tried downgrading to CXF 2.2.9 and I'm back to my original problem under 2.2.6, which is that I am unable to get validation to turn on using the {{schema-validation-enabled}}.
\\
\\
{code:xml|title=WSDL}
<wsdl:definitions
  name="EvaluatorService"
  targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:tns="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:ereq="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:eresp="http://my.company.org/wsdl/jca/EvaluatorService"
  >
 
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorRequest.xsd"/>
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorResponse.xsd"/>
  <!--
  **************************************************************************
  WSDL Types
  ************************************************************************** -->
  <wsdl:types>
    <xs:schema elementFormDefault="qualified"
      targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
      version="1.0">
     
      <xs:element name="evaluate">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" ref="ereq:eval-request"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
 
      <xs:element name="eval-response" type="tns:eval-response"/>
     
      <xs:complexType name="eval-response">
        <xs:sequence>
          <xs:element minOccurs="0"  ref="eresp:document-eval-result"/>
        </xs:sequence>
      </xs:complexType>
     
    </xs:schema>
  </wsdl:types>

8<--------------- snip 8< -----------------------
{code}

{code:title=EvaluatorServiceImpl.java}
8<--------------- snip 8< -----------------------

@WebService(
    endpointInterface = "org.my.company.jca.evaluator.service.EvaluatorService",
      targetNamespace = "http://my.company.org/wsdl/jca/EvaluatorService",  
         wsdlLocation = "EvaluatorService.wsdl"
)
@SchemaValidation(enabled=true)

8<--------------- snip 8< -----------------------
{code}

{code:xml|title=Spring Configuration}
8<--------------- snip 8< -----------------------

  <!--
  **************************************************************************
  JAX-WS web services, provided via Apache CXF
  ************************************************************************** -->
  <bean id="evaluatorServiceImpl" class="org.my.company.jca.evaluator.service.EvaluatorServiceImpl"/>
 
  <!-- Webservice endpoint configuration -->
  <jaxws:endpoint
    id="evaluator"
    implementor="#evaluatorServiceImpl"
    address="/evaluatorService"
    xmlns:s="http://my.company.org/wsdl/jca/EvaluatorService"
    serviceName="s:EvaluatorService"
    wsdlLocation="EvaluatorService.wsdl" >
    <jaxws:schemaLocations>
      <jaxws:schemaLocation>classpath:EvaluatorRequest.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorDocument.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorResponse.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorTypes.xsd</jaxws:schemaLocation>
    </jaxws:schemaLocations>
    <jaxws:features>
      <bean class="org.apache.cxf.feature.LoggingFeature"/>
    </jaxws:features>
    <jaxws:properties>
      <entry key="schema-validation-enabled" value="true" />
    </jaxws:properties>   
  </jaxws:endpoint>

8<--------------- snip 8< -----------------------
{code}

{code:title=Exceptions}
WARNING: SAXException for newSchema()
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'ereq:eval-request' to a(n) 'element declaration' component.

WARNING: Interceptor for {http://my.company.org/wsdl/jca/EvaluatorService}EvaluatorService#{http://my.company.org/wsdl/jca/EvaluatorService}evaluate has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns2:eval-response'.
{code}



      was (Author: jrmihalick):
    I am having a similar problem to this.  I have the WSDL (pertinent portions included below), which I initially generated using CXF tools, but have modified  to make it more modular.  The WSDL has several imports to import schemas from the root of my webapp.  The WSDL validates fine using oXygen WSDL validation tools.  My service works just fine as well so long as I do not turn on validation.  Under CXF 2.2.6 I was unable to get validation to turn on using the jaxws property {{schema-validation-enabled}}, so I upgraded to CXF 2.3.0 to see if the {{@SchemaValidation}} annotation would work.  It did!  However, I immediately starting getting Xerces {{SaxParseExceptions}} (also included below) which said it could not find the declaration of elements and that it could not resolve some names.  I then discovered the {{<jaxws:schemaLocation>}} configuration and added my schemas.  It made no difference.  I set a breakpoint on {{com.sun.org.apache.xerces.internal.jaxp.XMLSchemaFactory}} (line 210, {{fXMLSchemaLoader.loadGrammar(xmlInputSources);}}) and noticed that the WSDL is the only file resource being supplied to the SchemaLoader.  What other things can I try?  Is this the same problem?  I tried downgrading to CXF 2.2.9 and I'm back to my original problem under 2.2.6, which is that I am unable to get validation to turn on using the {{schema-validation-enabled}}.
\\
\\
{code:xml|title=WSDL}
<wsdl:definitions
  name="EvaluatorService"
  targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:tns="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:ereq="http://my.company.org/wsdl/jca/EvaluatorService"
  xmlns:eresp="http://my.company.org/wsdl/jca/EvaluatorService"
  >
 
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorRequest.xsd"/>
  <xs:import namespace="http://my.company.org/wsdl/jca/EvaluatorService"
    schemaLocation="EvaluatorResponse.xsd"/>
  <!--
  **************************************************************************
  WSDL Types
  ************************************************************************** -->
  <wsdl:types>
    <xs:schema elementFormDefault="qualified"
      targetNamespace="http://my.company.org/wsdl/jca/EvaluatorService"
      version="1.0">
     
      <xs:element name="evaluate">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" ref="ereq:eval-request"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
 
      <xs:element name="eval-response" type="tns:eval-response"/>
     
      <xs:complexType name="eval-response">
        <xs:sequence>
          <xs:element minOccurs="0"  ref="eresp:document-eval-result"/>
        </xs:sequence>
      </xs:complexType>
     
    </xs:schema>
  </wsdl:types>

8<--------------- snip 8< -----------------------
{code}

{code:title=MyServiceImpl.java}
@WebService(
    endpointInterface = "org.my.company.jca.evaluator.service.EvaluatorService",
      targetNamespace = "http://my.company.org/wsdl/jca/EvaluatorService",  
         wsdlLocation = "EvaluatorService.wsdl"
)
@SchemaValidation(enabled=true)

8<--------------- snip 8< -----------------------
{code}

{code:xml|title=Spring Configuration}
8<--------------- snip 8< -----------------------

  <!--
  **************************************************************************
  JAX-WS web services, provided via Apache CXF
  ************************************************************************** -->
  <bean id="evaluatorServiceImpl" class="org.my.company.jca.evaluator.service.EvaluatorServiceImpl"/>
 
  <!-- Webservice endpoint configuration -->
  <jaxws:endpoint
    id="evaluator"
    implementor="#evaluatorServiceImpl"
    address="/evaluatorService"
    xmlns:s="http://my.company.org/wsdl/jca/EvaluatorService"
    serviceName="s:EvaluatorService"
    wsdlLocation="EvaluatorService.wsdl" >
    <jaxws:schemaLocations>
      <jaxws:schemaLocation>classpath:EvaluatorRequest.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorDocument.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorResponse.xsd</jaxws:schemaLocation>
      <jaxws:schemaLocation>classpath:EvaluatorTypes.xsd</jaxws:schemaLocation>
    </jaxws:schemaLocations>
    <jaxws:features>
      <bean class="org.apache.cxf.feature.LoggingFeature"/>
    </jaxws:features>
    <jaxws:properties>
      <entry key="schema-validation-enabled" value="true" />
    </jaxws:properties>   
  </jaxws:endpoint>

8<--------------- snip 8< -----------------------
{code}

{code:title=Exceptions}
WARNING: SAXException for newSchema()
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'ereq:eval-request' to a(n) 'element declaration' component.

WARNING: Interceptor for {http://my.company.org/wsdl/jca/EvaluatorService}EvaluatorService#{http://my.company.org/wsdl/jca/EvaluatorService}evaluate has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns2:eval-response'.
{code}


  
> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>             Fix For: NeedMoreInfo
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jean-Claude Souvignet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12967131#action_12967131 ] 

Jean-Claude Souvignet commented on CXF-3095:
--------------------------------------------

Hi,

I have same issue : 
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find the declaration of element 'ckReponse'.

I test with CXF 2.2.7, 2.2.9 et 2.2.10.

A complete maven project that illustrate it is joined (wsVal.zip)

Do there are a way to validate only the request  and not the response ?



> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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


[jira] Issue Comment Edited: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented

Posted by "Jason Mihalick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969760#action_12969760 ] 

Jason Mihalick edited comment on CXF-3095 at 12/9/10 10:12 AM:
---------------------------------------------------------------

Freeman, 

My scenario isn't quite the same. Ideally, I would like to have 4 separate namespaces: 

* A namespace for the *service* 
* A namespace for the *request* 
* A namespace for a *document* that I am including in the request 
* A namespace for the *response* 

Because I couldn't get it to work otherwise, I put the *request* and *response* in the same namespace as the *service*. But, this is not what I really want. 

Does import of namespaces work? 

      was (Author: jrmihalick):
    Freeman, 

My scenario isn't quite the same. Ideally, I would like to have 4 separate namespaces: 

* A namespace for the *service* 
* A namespace for the *request* 
* A namespace for a *document* that I am including in the request 
* A namespace for the *response* 

Because I couldn't get it to work otherwise, I put the *request* and *response* in the same namespace as the service. But, this is not what I really want. 

Does import of namespaces work? 
  
> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>
>                 Key: CXF-3095
>                 URL: https://issues.apache.org/jira/browse/CXF-3095
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.10, 2.2.11
>         Environment: running in tomcat 6
>            Reporter: Patrick Leamon
>            Assignee: Freeman Fang
>             Fix For: NeedMoreInfo
>
>         Attachments: wsVal.zip
>
>
> I'm having very odd schema validation issues since moving from cxf 2.0.11 to cxf 2.2.10.
> The beans.xml I'm using to configure the web service looks something like:
> {code:xml}
>     <jaxws:endpoint id="LocationServiceId"
>                     implementor="com.blah.LocationServiceImpl"
>                     address="/services/location">
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>         <jaxws:schemaLocations>
>             <jaxws:schemaLocation>classpath:xsd/common-types.xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-types..xsd</jaxws:schemaLocation>
>             <jaxws:schemaLocation>classpath:xsd/location-service.xsd</jaxws:schemaLocation>
>         </jaxws:schemaLocations>
>     </jaxws:endpoint>
> {code}
> The first five requests that I send to this web service function correctly.  Any further requests result in:
> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element 'ns1:locationElement'
> Previously in 2.0.11 this was working fine, regardless of the number of requests being sent.
> *edit* Reverting to 2.2.9 works perfectly.  It looks like the code path that reads in schemaLocations was disabled by the fix to CXF-2851.

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