MessageBodyWriter mbw = ProviderFactory.getInstance(outMessage).createMessageBodyWriter(
cls, type, anns, contentType, outMessage);
if (mbw != null) {
try {
mbw.writeTo(o, cls, type, anns, contentType, headers, os);
if (os != null) {
os.flush();
}
} catch (Exception ex) {
reportMessageHandlerProblem("MSG_WRITER_PROBLEM", cls, contentType, ex, null);