From 390c74a9ae84d3dc717aef51a526acc32eb4ec42 Mon Sep 17 00:00:00 2001 From: David BRASSELY Date: Mon, 18 Mar 2013 15:20:08 +0100 Subject: [PATCH 1/3] ESBCOMP-20 Display URL that causes error when invoking external WS --- .../httpsoapbc/async/AsyncResponseProcessor.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java b/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java index d76a2d841..48312e04b 100755 --- a/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java +++ b/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java @@ -96,15 +96,17 @@ public class AsyncResponseProcessor implements Runnable { context.getEndpoint().getEndpointStatus().incrementReceivedReplies(); replyHTTP((DataSource) result); } else { - final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1001"); - logger.warning(err); + //final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1001"); + suspendTransaction(); + logger.warning("HTTPBC-E1001: Unsupported response media"); return; } - try { + try { + suspendTransaction(); context.getChannel().send(context.getInout()); } catch (MessagingException ex) { - final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1002"); - logger.warning(err); + //final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1002"); + logger.warning(new StringBuilder("HTTPBC-E1002: ").append(ex.getMessage()).toString()); } } finally { @@ -195,6 +197,7 @@ public class AsyncResponseProcessor implements Runnable { } private void replyError(Throwable t) { + logger.warning("HTTPBC: Exchange fault for service URL: " + context.getEndpoint().getEndpointUrl() + " : " + t.getLocalizedMessage()); setExchangeFaulty((Exception) t, CLIENT, "", t.getLocalizedMessage()); } @@ -271,7 +274,7 @@ public class AsyncResponseProcessor implements Runnable { private void resumeTransaction() { javax.transaction.Transaction tx = (Transaction) context.getInout().getProperty(context.getInout().JTA_TRANSACTION_PROPERTY_NAME); if (tx != null) { - TransactionsUtil.resumeTransaction(tx); + txResumed = TransactionsUtil.resumeTransaction(tx); } } @@ -279,6 +282,7 @@ public class AsyncResponseProcessor implements Runnable { try { if (txResumed) { TransactionsUtil.suspendTransaction(); + txResumed = false; } } catch (SystemException ex) {/* I hope noone uses misterious XA*/ From d6ab2f7766e6dc811b8622dadae2aa8ffa4bb9c6 Mon Sep 17 00:00:00 2001 From: David BRASSELY Date: Mon, 18 Mar 2013 15:29:55 +0100 Subject: [PATCH 2/3] Revert "ESBCOMP-20 Display URL that causes error when invoking external WS" This reverts commit 390c74a9ae84d3dc717aef51a526acc32eb4ec42. --- .../httpsoapbc/async/AsyncResponseProcessor.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java b/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java index 48312e04b..d76a2d841 100755 --- a/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java +++ b/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java @@ -96,17 +96,15 @@ public class AsyncResponseProcessor implements Runnable { context.getEndpoint().getEndpointStatus().incrementReceivedReplies(); replyHTTP((DataSource) result); } else { - //final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1001"); - suspendTransaction(); - logger.warning("HTTPBC-E1001: Unsupported response media"); + final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1001"); + logger.warning(err); return; } - try { - suspendTransaction(); + try { context.getChannel().send(context.getInout()); } catch (MessagingException ex) { - //final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1002"); - logger.warning(new StringBuilder("HTTPBC-E1002: ").append(ex.getMessage()).toString()); + final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1002"); + logger.warning(err); } } finally { @@ -197,7 +195,6 @@ public class AsyncResponseProcessor implements Runnable { } private void replyError(Throwable t) { - logger.warning("HTTPBC: Exchange fault for service URL: " + context.getEndpoint().getEndpointUrl() + " : " + t.getLocalizedMessage()); setExchangeFaulty((Exception) t, CLIENT, "", t.getLocalizedMessage()); } @@ -274,7 +271,7 @@ public class AsyncResponseProcessor implements Runnable { private void resumeTransaction() { javax.transaction.Transaction tx = (Transaction) context.getInout().getProperty(context.getInout().JTA_TRANSACTION_PROPERTY_NAME); if (tx != null) { - txResumed = TransactionsUtil.resumeTransaction(tx); + TransactionsUtil.resumeTransaction(tx); } } @@ -282,7 +279,6 @@ public class AsyncResponseProcessor implements Runnable { try { if (txResumed) { TransactionsUtil.suspendTransaction(); - txResumed = false; } } catch (SystemException ex) {/* I hope noone uses misterious XA*/ From de19839ed3ba3bcfd792a2eb1cc8fe1a17758bdd Mon Sep 17 00:00:00 2001 From: David BRASSELY Date: Mon, 18 Mar 2013 15:33:20 +0100 Subject: [PATCH 3/3] ESBCOMP-20 Display URL that causes an error when accessing external webservice from HTTPBC --- .../src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java b/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java index d76a2d841..d68dedf75 100755 --- a/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java +++ b/ojc-core/httpsoapbc/httpsoapbcimpl/src/com/sun/jbi/httpsoapbc/async/AsyncResponseProcessor.java @@ -195,6 +195,7 @@ public class AsyncResponseProcessor implements Runnable { } private void replyError(Throwable t) { + logger.warning("HTTPBC: Exchange fault for service URL: " + context.getEndpoint().getEndpointUrl() + " : " + t.getLocalizedMessage()); setExchangeFaulty((Exception) t, CLIENT, "", t.getLocalizedMessage()); }