Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-870

ClassCastException on context.proceed() in aroundInvoke

    Details

    • Release Notes Text:
      Hide
      The crux of this issue is that there were two possible return types (from the perspective of an Errai caller) for any JAX-RS method: the actual return type, or a Response if a ResponseCallback was used.

      This made it impossible for a generic interceptor to work in an app that used both RemoteCallbacks and ResponseCallbacks.

      As such ResponseCallback has been removed. JAX-RS RPC methods returning javax.ws.rs.core.Response can be called with a RemoteCallback<com.google.gwt.http.client.Response>. For any other RPC returning T, only a RemoteCallback<T> can be used.
      Show
      The crux of this issue is that there were two possible return types (from the perspective of an Errai caller) for any JAX-RS method: the actual return type, or a Response if a ResponseCallback was used. This made it impossible for a generic interceptor to work in an app that used both RemoteCallbacks and ResponseCallbacks. As such ResponseCallback has been removed. JAX-RS RPC methods returning javax.ws.rs.core.Response can be called with a RemoteCallback<com.google.gwt.http.client.Response>. For any other RPC returning T, only a RemoteCallback<T> can be used.

      Description

      When implementing RestClientInterceptor and calling context.proceed() with callbacks ClassCastException is thrown. The issue was described here with a good example, so I won't repeat it. The problem with the suggested solution is that there is no way for me to know if the original callback uses RemoteCallback or ResponseCallback. Since both RemoteCallback and ResponseCallback are used in the application, there is no way to avoid the error.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                dsharinov Dima Sharinov
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: