Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3945

AegisSchemaValidationInInterceptor trying to setup validation for ?wsdl request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.4.1
    • 2.4.4
    • None
    • None
    • Unknown

    Description

      I have a service that is using Aegis for the databindings. If I switch on message validation as follows:

      <jaxws:properties>
        <entry key="schema-validation-enabled" value="true"/>
      </jaxws:properties>
      

      And then make a request for the WSDL, http://localhost:8080/webservices/soap/myService?wsdl I get the following response:

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
          <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>Fault occurred while processing.</faultstring>
          </soap:Fault>
        </soap:Body>
      </soap:Envelope>
      

      And the following stack trace:

      java.lang.NullPointerException
      	at org.apache.cxf.wstx_msv_validation.Stax2ValidationUtils.setupValidation(Stax2ValidationUtils.java:71)
      	at org.apache.cxf.wstx_msv_validation.WoodstoxValidationImpl.setupValidation(WoodstoxValidationImpl.java:67)
      	at org.apache.cxf.aegis.databinding.AegisSchemaValidationInInterceptor.setSchemaInMessage(AegisSchemaValidationInInterceptor.java:68)
      	at org.apache.cxf.aegis.databinding.AegisSchemaValidationInInterceptor.handleMessage(AegisSchemaValidationInInterceptor.java:56)
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
      	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)
      	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208)
      	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
      	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:205)
      	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:113)
      	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)
      	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:112)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      

      It looks like this is because there is no XMLStreamReader for a GET request. This could be fixed by changing the handleMessage method in AegisSchemaValidationInInterceptor to only call setSchemaInMessage if it is not a WSDL GET request.

      Found in version 2.4.1, but checked trunk source code, and there don't appear to have been any changes here.

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            mrpotes James Phillpotts
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: