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

ClassCastException for Throwable produced by ResponseExceptionMapper

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.6.0.Final, 4.0.0.Beta4
    • 3.5.0.Final
    • jaxrs
    • None

    Description

      Scenario

      I'm using the Microprofile Restclient on WildFly 12.0.0.Final.

      My application registers a ResponseExceptionMapper<RuntimeException> with default priority which will take precedence over the DefaultResponseExceptionMapper.

      I'm invoking a client method for which the server responds with HTTP status 400.

      Expected Behaviour

      The Restclient throws a RuntimeException produced by my mapper.

      Actual Behaviour

      The Restclient throws a ClassCastException:

      Caused by: java.lang.ClassCastException: java.lang.RuntimeException cannot be cast to javax.ws.rs.WebApplicationException
      	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.filterResponse(ClientInvocation.java:648)
      	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:442)
      	at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:102)
      	at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:76)
      

      Attachments

        Activity

          People

            pjurak Petr Jurak (Inactive)
            hwellmann.de Harald Wellmann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: