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

Booking a flight for non-existent flight should result in NoSuchFlightException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.0.2
    • Component/s: Samples
    • Labels:
      None

      Description

      Submitting an invalid flight number (e.g. KL9999) bubbles up as an EmptyResultDataAccessException instead of NoSuchFlightException. This is because the JpaFlightDao uses query.getSingleResult(), which can throw a NoResultException instead of returning null. Submitting an invalid username has a similar issue.

      I've created a fix in the JPA DAO's to ensure they catch a NoResultException and re-throw it as a business exception. In the case of an invalid username I added a NoSuchUsernameException business exception.

      See attached patch for a root-level Eclipse project named 'airline' created with 'mvn eclipse:eclipse' from the samples directory and connected to the Spring-WS SVN repository.

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              rstoya05-aop Rossen Stoyanchev
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: