cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Mihalick (JIRA)" <>
Subject [jira] Commented: (CXF-3095) Jax WS - Schema Locations are ignored since CXF-2851 was implemented
Date Fri, 03 Dec 2010 17:11:11 GMT


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 {{}}
(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}}.
  <xs:import namespace=""
  <xs:import namespace=""
  WSDL Types
  ************************************************************************** -->
    <xs:schema elementFormDefault="qualified"
      <xs:element name="evaluate">
            <xs:element minOccurs="0" ref="ereq:eval-request"/>
      <xs:element name="eval-response" type="tns:eval-response"/>
      <xs:complexType name="eval-response">
          <xs:element minOccurs="0"  ref="eresp:document-eval-result"/>

    endpointInterface = "",
      targetNamespace = "",  
         wsdlLocation = "EvaluatorService.wsdl"

{code:xml|title=Spring Configuration}
  JAX-WS web services, provided via Apache CXF
  ************************************************************************** -->
  <bean id="evaluatorServiceImpl" class=""/>
  <!-- Webservice endpoint configuration -->
    wsdlLocation="EvaluatorService.wsdl" >
      <bean class="org.apache.cxf.feature.LoggingFeature"/>
      <entry key="schema-validation-enabled" value="true" />

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 {}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'.

> Jax WS - Schema Locations are ignored since CXF-2851 was implemented
> --------------------------------------------------------------------
>                 Key: CXF-3095
>                 URL:
>             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
> *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.

View raw message