Author: deepal
Date: Tue Sep 25 06:45:47 2007
New Revision: 579246
URL: http://svn.apache.org/viewvc?rev=579246&view=rev
Log:
seems like we are not handling Duplicate messages correctly and if some thing
went wrong in the CallBackReciever then we try to send a fult to the server.
but we do not have transport information to send the message. So we just drop
the message
Modified:
webservices/sandesha/branches/sandesha2/java/1_3/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java
Modified:
webservices/sandesha/branches/sandesha2/java/1_3/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java
URL:
http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_3/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java?rev=579246&r1=579245&r2=579246&view=diff
==============================================================================
---
webservices/sandesha/branches/sandesha2/java/1_3/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java
(original)
+++
webservices/sandesha/branches/sandesha2/java/1_3/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java
Tue Sep 25 06:45:47 2007
@@ -214,28 +214,43 @@
if (requestResponseTransport!=null)
requestResponseTransport.signalFaultReady(fault);
else {
- if ((faultContext.getTransportOut() != null) ||
-
(faultContext.getProperty(MessageContext.TRANSPORT_OUT) != null)) {
- AxisEngine.sendFault(faultContext);
- } else {
- log.warn("Both the TO and MessageContext.TRANSPORT_OUT
property are null," +
- " so nowhere to send the fault");
- }
+ sendFaultIfPossible(faultContext);
}
-
} else {
- if ((faultContext.getTransportOut() != null) ||
-
(faultContext.getProperty(MessageContext.TRANSPORT_OUT) != null)) {
- AxisEngine.sendFault(faultContext);
- } else {
- log.warn("Both the TO and MessageContext.TRANSPORT_OUT
property are null," +
- " so nowhere to send the fault");
- }
+ sendFaultIfPossible(faultContext);
}
} catch (AxisFault e1) {
if (log.isErrorEnabled())
log.error("Unable to send fault message ", e1);
}
}
-
+
+ /**
+ * Trying to fix the error given by Axis2 when we try to send fault
without required info.
+ * This happens because duplicate handling is not correctly eliminating
application response message.
+ * This is a temporary work around until the bug is fixed.
+ * @param faultContext
+ * @throws AxisFault
+ */
+ private void sendFaultIfPossible(MessageContext faultContext) throws
AxisFault {
+ EndpointReference epr = null;
+ String transportURL = (String) faultContext
+ .getProperty(Constants.Configuration.TRANSPORT_URL);
+
+ if (transportURL != null) {
+ epr = new EndpointReference(transportURL);
+ } else if (faultContext.getTo() != null
+ && !faultContext.getTo().hasAnonymousAddress()) {
+ epr = faultContext.getTo();
+ }
+ Object transportOut =
faultContext.getProperty(MessageContext.TRANSPORT_OUT);
+
+ if (epr == null && transportOut == null) {
+ log.warn("Both the TO and MessageContext.TRANSPORT_OUT property
are null," +
+ " so nowhere to send the fault");
+ } else {
+ AxisEngine.sendFault(faultContext);
+ }
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]