Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-3847

Memory leak in JBoss WS CXF Client's HandlerChainSortInterceptor

    XMLWordPrintable

    Details

      Description

      HandlerChainSortInterceptor.handleMessage(Message) sorts and sets JAX-WS handlers every time it handles a SOAP message:

         public void handleMessage(Message message) throws Fault
         {
            if (binding != null) {
               @SuppressWarnings("rawtypes")
               List<Handler> list = binding.getHandlerChain();
               if (list != null && !list.isEmpty()) {
                  Collections.sort(list, comparator);
                  binding.setHandlerChain(list);
               }
            }
         }
      

      However, inside the org.apache.cxf.jaxws.binding.AbstractBindingImpl and org.apache.cxf.jaxws.support.JaxWsEndpointImpl implementations the handler chain is not reset every time but piled up with interceptors, which leads to subtle but indefinite memory leak in JBoss WS CXF client.

      Furthermore, org.apache.cxf.jaxws.support.JaxWsEndpointImpl holds the interceptors as a kind of java.util.concurrent.CopyOnWriteArrayList. So modifying the growing list of interceptors per each message should cause a growing performance drawback, which is also not a good implementation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rhn-support-asoldano Alessio Soldano
              Reporter:
              rhn-support-tasato Tadayoshi Sato
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: