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

Add a check of the message content list to avoid the OoM error from the HolderOutInterceptor

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.4.1, 2.3.5
    • JAX-WS Runtime
    • None

    Description

      The blow code in the HolderOutInterceptor will throw the OOM error when the inObjects is same with the outObjects.
      Although this issue only happens when the Camel route set a wrong response message body, but it could be helpful if CXF can write some error log for it and prevent the OOM error.

           if (!Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
                  List<MessagePartInfo> parts = op.getOutput().getMessageParts();
                  MessageContentsList inObjects = MessageContentsList.getContentsList(exchange.getInMessage());
                  if (inObjects != null) {
                      for (int x = 0; x < inObjects.size(); x++) {
                          Object o = inObjects.get(x);
                          if (o instanceof Holder) {
                              outObjects.set(x + 1, o);
                          }
                      }
                  }
                  ......
              }
      

      Attachments

        Issue Links

          Activity

            People

              njiang Willem Jiang
              njiang Willem Jiang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: