// get the problematic command message from the exception
Message message = e.message;
// remove the problematic message from the queue
dbMessageSessionImpl.receiveByIdNoWait(message.getId());
message = Message.createCopy(message);
// update the message with the stack trace
StringWriter sw = new StringWriter();