Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-2027

CXFJaxrsService doesn't initialize in/outInterceptors properly.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 2.22.11, 2.24.03, 2.25.01-alpha
    • None
    • None

    Description

      Giuseppe Rogato found this problem and reported a solution in the mailinglist. Thank you so much!!

      -------- Original Message --------
      Subject: [Hippo-cms7-user] Jaxrs Service Configuration
      Date: Tue, 31 Jan 2012 10:51:27 +0100
      From: Giuseppe Rogato
      To: Hippo CMS 7 development public mailinglist <hippo-cms7-user@lists.onehippo.org>

      Hi guys
      since hst 2.22.09 i noticed a small issue in the class org.hippoecm.hst.jaxrs.cxf.CXFJaxrsService.
      Basically the method createBus
      is used to configure all the CXF Bus Incerceptors but all the interceptors are managed as InInterceptor
      That the actual implementation: (hst 2.22.10)

      protected Bus createBus() {
      BusFactory.setThreadDefaultBus(null);
      Bus bus = BusFactory.getThreadDefaultBus(true);

      if (inInterceptors != null && !inInterceptors.isEmpty())

      { bus.getInInterceptors().addAll(inInterceptors); }

      if (inFaultInterceptors != null && !inFaultInterceptors.isEmpty()) { bus.getInInterceptors().addAll(inFaultInterceptors); }

      if (outInterceptors != null && !outInterceptors.isEmpty()) { bus.getInInterceptors().addAll(outInterceptors); }

      if (outFaultInterceptors != null && !outFaultInterceptors.isEmpty()) { bus.getInInterceptors().addAll(outFaultInterceptors); }

      return bus;
      }

      I have fixed the issue changing the implementation in this way:

      protected Bus createBus() {
      BusFactory.setThreadDefaultBus(null);
      Bus bus = BusFactory.getThreadDefaultBus(true);
      if (inInterceptors != null && !inInterceptors.isEmpty()) { bus.getInInterceptors().addAll(inInterceptors); }

      if (inFaultInterceptors != null && !inFaultInterceptors.isEmpty())

      { bus.getInFaultInterceptors().addAll(inFaultInterceptors); }

      if (outInterceptors != null && !outInterceptors.isEmpty())

      { bus.getOutInterceptors().addAll(outInterceptors); }

      if (outFaultInterceptors != null && !outFaultInterceptors.isEmpty())

      { bus.getOutFaultInterceptors().addAll(outFaultInterceptors); }

      return bus;
      }

      Attachments

        Activity

          People

            jsheriff Junaidh Kadhar Sheriff
            wko Woonsan Ko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: