[jbossws-commits] JBossWS SVN: r9589 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src: main/java/org/jboss/wsf/stack/jbws and 1 other directories.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Thu Mar 12 08:57:23 EDT 2009
Author: darran.lofthouse at jboss.com
Date: 2009-03-12 08:57:23 -0400 (Thu, 12 Mar 2009)
New Revision: 9589
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ServerHandler.java
Log:
[JBPAPP-1772] Fault handler chain is not called when user application exceptions are thrown.
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2009-03-12 12:53:40 UTC (rev 9588)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2009-03-12 12:57:23 UTC (rev 9589)
@@ -221,8 +221,8 @@
}
catch (InvocationTargetException th)
{
- // Unwrap the throwable raised by the service endpoint implementation
- Throwable targetEx = ((InvocationTargetException)th).getTargetException();
+ //Unwrap the throwable raised by the service endpoint implementation
+ Throwable targetEx = th.getTargetException();
throw (targetEx instanceof Exception ? (Exception)targetEx : new UndeclaredThrowableException(targetEx));
}
@@ -266,14 +266,14 @@
faultType[0] = null;
}
}
- catch (RuntimeException ex)
+ catch (Exception ex)
{
// Reverse the message direction
processPivotInternal(msgContext, direction);
-
+
+ CommonBinding binding = bindingProvider.getCommonBinding();
try
{
- CommonBinding binding = bindingProvider.getCommonBinding();
binding.bindFaultMessage(ex);
// call the fault handler chain
@@ -288,6 +288,7 @@
catch (RuntimeException subEx)
{
log.warn("Exception while processing handleFault: ", ex);
+ binding.bindFaultMessage(subEx);
ex = subEx;
}
throw ex;
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-03-12 12:53:40 UTC (rev 9588)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-03-12 12:57:23 UTC (rev 9589)
@@ -433,7 +433,7 @@
}
catch (Exception ex)
{
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ MessageAbstraction resMessage = MessageContextAssociation.peekMessageContext().getMessageAbstraction();
// In case we have an exception before the invoker is called
// we create the fault message here.
@@ -453,7 +453,7 @@
{
try
{
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ MessageAbstraction resMessage = MessageContextAssociation.peekMessageContext().getMessageAbstraction();
if (resMessage != null)
{
if (resMessage.isFaultMessage())
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ServerHandler.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ServerHandler.java 2009-03-12 12:53:40 UTC (rev 9588)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-1772/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ServerHandler.java 2009-03-12 12:57:23 UTC (rev 9589)
@@ -48,7 +48,7 @@
SOAPFault soapFault = soapMessage.getSOAPBody().getFault();
String faultString = soapFault.getFaultString();
- if (!faultString.equals("Don't worry it's just a test") && !faultString.equals("org.jboss.test.ws.jaxrpc.exception.UserException"))
+ if (!faultString.equals("Don't worry it's just a test") && !faultString.equals("org.jboss.test.ws.jaxrpc.samples.exception.UserException"))
throw new JAXRPCException("Unexpected fault string: " + faultString);
return true;
More information about the jbossws-commits
mailing list