Spring Integration
  1. Spring Integration
  2. INT-1689

GatewayProxyFactoryBean does not properly configure service proxy when service interfaces are hierarchical resulting in NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 2.0 Final
    • Fix Version/s: 2.0.1
    • Component/s: Core
    • Labels:
      None

      Description

      There are two reasons for NPE
      1. We are checking if gateway method exists on the service interface instead of checking for existence of the method in the hierarchy of the service interface. This results in the invocation.proceed() call instead of invoking the gateway method and since proxy's target is 'null' the following call in AOPUtils.invokeJoinpointUsingReflection(..) results in NPE

      return method.invoke(target, args);
      

      2. A side-effect that leads to the above; When determining the target methods of the service interface we only do it on the actual interface and not on its hierarchy

      Method[] methods = this.serviceInterface.getDeclaredMethods();
      

      should be this

      Method[] methods = ReflectionUtils.getAllDeclaredMethods(proxyInterface);
      

        Activity

        Hide
        Oleg Zhurakousky added a comment -

        We are now validating the methods not only on the interface but on its hierarchy

        Show
        Oleg Zhurakousky added a comment - We are now validating the methods not only on the interface but on its hierarchy

          People

          • Assignee:
            Oleg Zhurakousky
            Reporter:
            Oleg Zhurakousky
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: