Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-905

RestEasy doesn't answer Asynchronous request when validation fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.2.Final
    • 3.0.Final
    • None
    • None
    • Hide

      Have a rest method declared asynchronous e.g.

      public void register(final @Suspended AsynchronousResponse response, @Valid RegistrationInfo registrationInfo)

      Add some validation annotation to your bean e.g.

      @Size(min = 8, message = "String must containt at least 8 characters")
      public String userName

      Send a REST request that with a userName of only 6 characters and watch that no response is returned.

      Show
      Have a rest method declared asynchronous e.g. public void register(final @Suspended AsynchronousResponse response, @Valid RegistrationInfo registrationInfo) Add some validation annotation to your bean e.g. @Size(min = 8, message = "String must containt at least 8 characters") public String userName Send a REST request that with a userName of only 6 characters and watch that no response is returned.

    Description

      JAX-RS bean validation is performed before the request is put in asynchronous mode so when a validation exception is thrown no repsonse is returned to the client. The JAX-RS Suspended annotation suspends the request forever, the only way to set a time limit is using the asynchronous response object which cannot be accessed before we enter the method. Since validation happens first, the method is never entered.

      This issue is similar to the one reported in

      https://issues.jboss.org/browse/RESTEASY-721?_sscc=t and
      https://issues.jboss.org/browse/RESTEASY-858?_sscc=t

      The version 3.0 didn't fix the issue.

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            frigorn Francois Paulhus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: