Author: alessio.soldano(a)jboss.com
Date: 2008-02-12 10:39:30 -0500 (Tue, 12 Feb 2008)
New Revision: 5659
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
Log:
[JBWS-1941] Fixing issue
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2008-02-12
15:23:06 UTC (rev 5658)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2008-02-12
15:39:30 UTC (rev 5659)
@@ -217,16 +217,7 @@
Invocation inv = setupInvocation(endpoint, sepInv, invContext);
InvocationHandler invHandler = endpoint.getInvocationHandler();
- try
- {
- invHandler.invoke(endpoint, inv);
- }
- catch (InvocationTargetException th)
- {
- // Unwrap the throwable raised by the service endpoint implementation
- Throwable targetEx =
((InvocationTargetException)th).getTargetException();
- throw (targetEx instanceof Exception ? (Exception)targetEx : new
UndeclaredThrowableException(targetEx));
- }
+ invHandler.invoke(endpoint, inv);
// Handler processing might have replaced the endpoint invocation
sepInv =
inv.getInvocationContext().getAttachment(EndpointInvocation.class);
@@ -269,15 +260,20 @@
faultType[0] = null;
}
}
- catch (RuntimeException ex)
+ catch (InvocationTargetException invocationEx)
{
+ //Unwrap the throwable raised by the service endpoint implementation
+ Throwable targetEx = invocationEx.getTargetException();
+ Exception ex = targetEx instanceof Exception ? (Exception)targetEx : new
UndeclaredThrowableException(targetEx);
+
// Reverse the message direction
processPivotInternal(msgContext, direction);
try
{
CommonBinding binding = bindingProvider.getCommonBinding();
- binding.bindFaultMessage(ex);
+ MessageAbstraction exMessage = binding.bindFaultMessage(ex);
+ msgContext.setMessageAbstraction(exMessage);
// call the fault handler chain
boolean handlersPass = true;