Source:
<code>private void processChunking(NHttpClientConnection conn, MessageContext requestMsgCtx) throws IOException, AxisFault { String disableChunking = (String) requestMsgCtx.getProperty(PassThroughConstants.DISABLE_CHUNKING); String forceHttp10 = (String) requestMsgCtx.getProperty(PassThroughConstants.FORCE_HTTP_1_0); if ("true".equals(disableChunking) || "true".equals(forceHttp10)) { if (requestMsgCtx.getEnvelope().getBody().getFirstElement() == null) { BasicHttpEntity entity = (BasicHttpEntity) ((BasicHttpEntityEnclosingRequest) request).getEntity(); try { RelayUtils.buildMessage(requestMsgCtx); this.hasEntityBody = true; Pipe pipe = (Pipe) requestMsgCtx.getProperty(PassThroughConstants.PASS_THROUGH_PIPE); if (pipe != null) { pipe.attachConsumer(conn); this.connect(pipe); if (Boolean.TRUE.equals(requestMsgCtx.getProperty(PassThroughConstants.MESSAGE_BUILDER_INVOKED))) { ByteArrayOutputStream out = new ByteArrayOutputStream(); MessageFormatter formatter = MessageProcessorSelector.getMessageFormatter(requestMsgCtx); OMOutputFormat format = PassThroughTransportUtils.getOMOutputFormat(requestMsgCtx); formatter.writeTo(requestMsgCtx, format, out, false); OutputStream _out = pipe.getOutputStream(); IOUtils.write(out.toByteArray(), _out); entity.setContentLength(new Long(out.toByteArray().length)); entity.setChunked(false); } } } catch (XMLStreamException e) { <START> e.printStackTrace(); <END> } } } }</code><technical_language>a logger instead of printStackTrace</technical_language>

Target:
private void processChunking(NHttpClientConnection conn, MessageContext requestMsgCtx) throws IOException, AxisFault { String disableChunking = (String) requestMsgCtx.getProperty(PassThroughConstants.DISABLE_CHUNKING); String forceHttp10 = (String) requestMsgCtx.getProperty(PassThroughConstants.FORCE_HTTP_1_0); if (log.isDebugEnabled()) { log.debug("Process Chungking (disableChunking : " + disableChunking + ", forceHttp10 : " + forceHttp10 + ")"); } if (("true".equals(disableChunking) || "true".equals(forceHttp10)) && (requestMsgCtx.getEnvelope().getBody().getFirstElement() == null)) { if (log.isDebugEnabled()) { log.debug("Envelope Body is empty"); } BasicHttpEntity entity = (BasicHttpEntity) ((BasicHttpEntityEnclosingRequest) request).getEntity(); try { RelayUtils.buildMessage(requestMsgCtx); this.hasEntityBody = true; Pipe pipe = (Pipe) requestMsgCtx.getProperty(PassThroughConstants.PASS_THROUGH_PIPE); if (pipe != null) { pipe.attachConsumer(conn); this.connect(pipe); if (Boolean.TRUE.equals( requestMsgCtx.getProperty(PassThroughConstants.MESSAGE_BUILDER_INVOKED))) { ByteArrayOutputStream out = new ByteArrayOutputStream(); MessageFormatter formatter = MessageProcessorSelector.getMessageFormatter(requestMsgCtx); OMOutputFormat format = PassThroughTransportUtils.getOMOutputFormat(requestMsgCtx); formatter.writeTo(requestMsgCtx, format, out, false); IOUtils.write(out.toByteArray(), pipe.getOutputStream()); if (log.isDebugEnabled()) { log.debug("Set ContentLength : " + new Long(out.toByteArray().length)); } entity.setContentLength(new Long(out.toByteArray().length)); entity.setChunked(false); } } } catch (XMLStreamException e) { log.error("Error while process chunking", e); } } }