Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6793

InvocationCallback doesn't try to get response class type

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.5
    • Fix Version/s: 3.1.6, 3.0.9, 3.2.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      in org.apache.cxf.jaxrs.client.WebClient#doInvokeAsyncCallback the webclient could try to find the response class if not there.

      would avoid to give a null type the providers can't use to do what they need to

      Code can be if respClass is null and callback is not null something like:

      // in real code filter interfaces and dont access them directly by index
      ParameterizedType.class.cast(callback.getClass().getGenericInterfaces()[0]).getActualTypeArguments()[0]
      

      edit: digging a bit seems org.apache.cxf.jaxrs.utils.InjectionUtils#getSuperType just doesn't default to anything and in case of TypeVariable unbounded is not able to default to Object so if bound is really Object it fails

      if it helps here is the code I use: https://gist.github.com/rmannibucau/09a084c28d8b61c232cf - of course would like to make the class geenric (<T>) and remove this String typing

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              romain.manni-bucau Romain Manni-Bucau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: