How can I configure JBoss EAP 7 RESTeasy client to follow redirect?

Solution In Progress - Updated -


We are using a REST client that needs to resolve redirections. In JBoss EAP 6 with RESTEasy client API ClientRequest class we had the method request.followRedirects(true). So we're able to write the following to configure the client to follow redirects:

 ClientResponse<String> response = request.followRedirects(true).get(String.class);

Now when using the JAX-RS client for JBoss EAP 7.0.x and we don't see an equivalent method when creating the client using the following code:

If we don't set follow redirects an exception is thrown when the server response is 3XX HTTP codes:

Exception in thread "main" HTTP 301 Moved Permanently
    at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(
    at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(
    at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.get(
    at org.example.resteasy.FollowRedirectTests.doRequest(
    at org.example.resteasy.FollowRedirectTests.testWithoutFollowRedirect(
    at org.example.resteasy.FollowRedirectTests.main(

What can be done to configure our REST client to follow redirects?


  • Red Hat JBoss Application Platform (EAP)
    • 7.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.