e.printStackTrace();
log.error("Error while handling jms message", e);
    public void onMessage(final Message message) {        try {            endpoint.getServiceUnit().getComponent().getWorkManager().scheduleWork(new Work() {                public void release() {                }                public void run() {                    try {                        InOut exchange = (InOut) pendingExchanges.remove(message.getJMSCorrelationID());                        if (exchange == null) {                            throw new IllegalStateException("Could not find exchange " + message.getJMSCorrelationID());                        }                        if (message instanceof ObjectMessage) {                            Object o = ((ObjectMessage) message).getObject();                            if (o instanceof Exception) {                                exchange.setError((Exception) o);                            } else {                                throw new UnsupportedOperationException("Can not handle objects of type " + o.getClass().getName());                            }                        } else {                            InputStream is = null;                            if (message instanceof TextMessage) {                                is = new ByteArrayInputStream(((TextMessage) message).getText().getBytes());                            } else if (message instanceof BytesMessage) {                                int length = (int) ((BytesMessage) message).getBodyLength();                                byte[] bytes = new byte[length];                                ((BytesMessage) message).readBytes(bytes);                                is = new ByteArrayInputStream(bytes);                            } else {                                throw new IllegalArgumentException("JMS message should be a text or bytes message");                            }                            String contentType = message.getStringProperty("Content-Type");                            SoapMessage soap = soapMarshaler.createReader().read(is, contentType);                            NormalizedMessage out = exchange.createMessage();                            jbiMarshaler.toNMS(out, soap);                            ((InOut) exchange).setOutMessage(out);                        }                        channel.send(exchange);                    } catch (Exception e) {                        // TODO: log exception                        e.printStackTrace();                    }                }            });        } catch (WorkException e) {            // TODO: log exception            e.printStackTrace();        }    }