Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-777

SoapFaultMappingExceptionResolver not handling exception

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1 RC1
    • Fix Version/s: 2.1 GA
    • Component/s: Core
    • Labels:
      None

      Description

      Given the following configuration:

          <bean class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver">
              <property name="exceptionMappings">
                  <value>
                      org.springframework.dao.EmptyResultDataAccessException=CLIENT,Entity not found
                  </value>
              </property>
              <property name="defaultFault" value="SERVER"/>
          </bean>

      The result in 2.0.5 is correct:

      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
              <SOAP-ENV:Header/>
              <SOAP-ENV:Body>
                  <SOAP-ENV:Fault>
                      <faultcode>SOAP-ENV:Client</faultcode>
                      <faultstring xml:lang="en">Entity not found</faultstring>
                  </SOAP-ENV:Fault>
              </SOAP-ENV:Body>
          </SOAP-ENV:Envelope>

      The result in 2.1.0.RC1 is INCORRECT:

      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
          <SOAP-ENV:Header/>
          <SOAP-ENV:Body>
              <SOAP-ENV:Fault>
                  <faultcode>SOAP-ENV:Server</faultcode>
                  <faultstring xml:lang="en">Incorrect result size: expected 1, actual 0</faultstring>
              </SOAP-ENV:Fault>
          </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

        Issue Links

          Activity

          Hide
          arjen.poutsma Arjen Poutsma added a comment - - edited

          Hmm, that's strange. Do you also use <sws:annotation-driven>, by any chance? There were some changes to that in 2.1.

          Also: does the EmptyResultDataAccessException have a @SoapFault annotation, perhaps?

          Show
          arjen.poutsma Arjen Poutsma added a comment - - edited Hmm, that's strange. Do you also use <sws:annotation-driven> , by any chance? There were some changes to that in 2.1. Also: does the EmptyResultDataAccessException have a @SoapFault annotation, perhaps?
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Added formatting.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Added formatting.
          Hide
          gordonad Gordon Dickens added a comment -

          Arjen,

          Yes, I have configured <ws:annotation-driven/>

          I am using the examples from the Enterprise Integration with Spring course that I am teaching this week. I use those to run through the upcoming versions of SWS, SI & SB to determine any api changes to share with the students.

          Thanks,
          Gordon Dickens

          @gdickens
          linkedin.com/in/gordondickens
          Blog: technophile.gordondickens.com

          Show
          gordonad Gordon Dickens added a comment - Arjen, Yes, I have configured <ws:annotation-driven/> I am using the examples from the Enterprise Integration with Spring course that I am teaching this week. I use those to run through the upcoming versions of SWS, SI & SB to determine any api changes to share with the students. Thanks, Gordon Dickens @gdickens linkedin.com/in/gordondickens Blog: technophile.gordondickens.com
          Hide
          arjen.poutsma Arjen Poutsma added a comment - - edited

          Gordon,

          Can you elaborate which example(s) of the EI course show this problem? That makes it a bit easier to duplicate.

          EDIT: never mind, I found it myself in the ws-2 lab of the course.

          Thanks,

          Arjen

          Show
          arjen.poutsma Arjen Poutsma added a comment - - edited Gordon, Can you elaborate which example(s) of the EI course show this problem? That makes it a bit easier to duplicate. EDIT: never mind, I found it myself in the ws-2 lab of the course. Thanks, Arjen
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          It seems like SWS-772 was the culprit here. See my last comment on that issue for the reason.

          For the ws-2 lab, it seems like adding an ordered property will fix it, like so:

           
          <bean class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver">
              <property name="order" value="0"/>
              <property name="exceptionMappings">
                  <value>
                      org.springframework.dao.EmptyResultDataAccessException=CLIENT,Entity not found
                  </value>
              </property>
              <property name="defaultFault" value="SERVER"/>
          </bean>

          Show
          arjen.poutsma Arjen Poutsma added a comment - It seems like SWS-772 was the culprit here. See my last comment on that issue for the reason. For the ws-2 lab, it seems like adding an ordered property will fix it, like so:   < bean class = "org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver" > < property name = "order" value = "0" /> < property name = "exceptionMappings" > < value > org.springframework.dao.EmptyResultDataAccessException=CLIENT,Entity not found </ value > </ property > < property name = "defaultFault" value = "SERVER" /> </ bean >

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              gordonad Gordon Dickens
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 2h 1m
                2h 1m