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

ClientBuilder Does Not Recover After Server Errors


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.5.Final
    • 3.0.4.Final
    • jaxrs
    • None
    • Workaround Exists
    • Hide

      Do not recreate Clients for each call OR create a new ClientBuilder for each call.

      Do not recreate Clients for each call OR create a new ClientBuilder for each call.

      This is very similar to RESTEASY-963 - but the solution given there did not work for this.

      We have a system where a central server communicates with a multitude of remote servers using Resteasy to collate worldwide information. Quite often some of these remote servers will be down for whatever reason & we need to cope with this.

      If a client invoke call fails due to server error and subsequently a call is made to build a Client, the client build will return a client with no error. But any attempt to then use that client will result in a "java.lang.IllegalStateException: Manager is shut down" exception.

      Note that trapping the ResponseProcessingException and closing the Request (suggested as a solution for RESTEASY-963) does not fix this.

      Re-using the same Client after a server error however works OK.

      Attached is sample code; RestEasyRecovery1 re-uses the same Client after server failure and this works OK, RestEasyRecovery2 creates new Client each time and will fail after the call to the "bad server".

        1. Player.java
          2 kB
        2. PlayerResource.java
          2 kB
        3. RestEasyRecovery1.java
          2 kB
        4. RestEasyRecovery2.java
          2 kB
        5. RestEasySSLBasicAuthenticationServer.java
          2 kB

            patriot1burke@gmail.com Bill Burke (Inactive)
            geoffbland_jira Geoff Bland (Inactive)
            0 Vote for this issue
            2 Start watching this issue