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

ClientResponseFailure not thrown for 401 response

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • 2.2.0.GA
    • 2.3-beta-1
    • jaxrs
    • None
    • Hide

      Create a method that returns a java object such as an ArrayList, with RolesAllowed annotation. Call the method from the client side with the proper role, and there is no error. Call the method from the client side as a user without a role, and the server sends a 401 response, while the client gets a StackOverflowError rather than ClientResponseFailure.

      Show
      Create a method that returns a java object such as an ArrayList, with RolesAllowed annotation. Call the method from the client side with the proper role, and there is no error. Call the method from the client side as a user without a role, and the server sends a 401 response, while the client gets a StackOverflowError rather than ClientResponseFailure.

    Description

      ClientResponseFailure not thrown at client for 401 response for a method that normally returns an ArrayList. The 401 response was caused by an improper user role. When the user has the proper role, the method returns the ArrayList with no error. Client side created with org.jboss.resteasy.client.ProxyFactory.

      It appears that BaseClientResponse gets into an infinite loop, as shown in the stack trace below.

      java.lang.StackOverflowError
      ...
      at org.jboss.resteasy.client.ClientResponseFailure.<init>(ClientResponseFailure.java:32)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:488)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:479)
      at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:384)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:346)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:319)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:442)
      at org.jboss.resteasy.client.core.BaseClientResponse.copyFromError(BaseClientResponse.java:94)
      at org.jboss.resteasy.client.ClientResponseFailure.<init>(ClientResponseFailure.java:32)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:488)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:479)
      at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:384)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:346)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:319)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:442)
      at org.jboss.resteasy.client.core.BaseClientResponse.copyFromError(BaseClientResponse.java:94)
      at org.jboss.resteasy.client.ClientResponseFailure.<init>(ClientResponseFailure.java:32)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:488)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:479)
      at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:384)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:346)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:319)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:442)
      at org.jboss.resteasy.client.core.BaseClientResponse.copyFromError(BaseClientResponse.java:94)
      at org.jboss.resteasy.client.ClientResponseFailure.<init>(ClientResponseFailure.java:32)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:488)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:479)
      at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:384)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:346)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:319)
      at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:442)
      at org.jboss.resteasy.client.core.BaseClientResponse.copyFromError(BaseClientResponse.java:94)
      at org.jboss.resteasy.client.ClientResponseFailure.<init>(ClientResponseFailure.java:32)
      at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:488)
      ....

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            rieman_jira ron cook (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: