AbstractInOutAsyncMessageReceiver : in method invokeBusinessLogic, wrong
parameter for engine.send(...)
-------------------------------------------------------------------------------------------------------
Key: AXIS2-462
URL: http://issues.apache.org/jira/browse/AXIS2-462
Project: Apache Axis 2.0 (Axis2)
Type: Bug
Components: core
Versions: 0.93, 0.94
Environment: All operating systems/plateforms
Reporter: Jean-Sébastien Ricard
Priority: Blocker
In the invokeBusinessLogic method, and particulary in the handleResult()
method, when calling the engine.send(..) method, the incoming MessageContext is
send (messageCtx) rather than result one (result).
Here after the fixed source code :
public abstract class AbstractInOutAsyncMessageReceiver extends
AbstractMessageReceiver {
protected Log log = LogFactory.getLog(getClass());
public abstract void invokeBusinessLogic(MessageContext inMessage,
MessageContext outMessage,
ServerCallback callback)
throws AxisFault;
public final void receive(final MessageContext messageCtx) throws AxisFault
{
final ServerCallback callback = new ServerCallback() {
public void handleResult(MessageContext result) throws AxisFault {
AxisEngine engine =
new
AxisEngine(messageCtx.getOperationContext().getServiceContext()
.getConfigurationContext());
// BUG
//engine.send(messageCtx);
// FIXED
engine.send(result);
}
public void handleFault(AxisFault fault) throws AxisFault {
AxisEngine engine =
new
AxisEngine(messageCtx.getOperationContext().getServiceContext()
.getConfigurationContext());
MessageContext faultContext =
engine.createFaultMessageContext(messageCtx, fault);
engine.sendFault(faultContext);
}
};
Runnable theadedTask = new Runnable() {
public void run() {
try {
MessageContext newmsgCtx =
Utils.createOutMessageContext(messageCtx);
newmsgCtx.getOperationContext().addMessageContext(newmsgCtx);
invokeBusinessLogic(messageCtx, newmsgCtx, callback);
} catch (AxisFault e) {
log.error(e);
}
}
};
messageCtx.getConfigurationContext().getThreadPool().execute(theadedTask);
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira