summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/interface-java-jaxws
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-01-08 09:33:52 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-01-08 09:33:52 +0000
commit34c88286730142d4e42c0136565d6365d5013008 (patch)
tree5835e85fb8de1adae10457fdf15bff48e8c8e2e9 /branches/sca-java-1.x/modules/interface-java-jaxws
parentc9ca2d6c3bf93ec7b24775b2ccf0a76a04816aef (diff)
More complete fix for TUSCANY-2593
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@732664 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/interface-java-jaxws')
-rw-r--r--branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java65
1 files changed, 43 insertions, 22 deletions
diff --git a/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java b/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
index 5b7485e3c2..0cd6286c87 100644
--- a/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
+++ b/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
@@ -120,41 +120,62 @@ public class JAXWSFaultExceptionMapper implements FaultExceptionMapper {
} catch (Throwable e) {
// Ignore
}
- try {
- // FIXME: What about if the faultBeanClass is a subclass of the argument type?
- ctor = exceptionClass.getConstructor(String.class, faultBeanClass, Throwable.class);
- ex = ctor.newInstance(message, faultInfo, cause);
- } catch (NoSuchMethodException e1) {
+ if (faultInfo == null) {
try {
- if (faultInfo != null) {
- ctor = exceptionClass.getConstructor(String.class, faultInfo.getClass());
- ex = ctor.newInstance(message, faultInfo);
- } else {
+ ctor = exceptionClass.getConstructor(String.class, Throwable.class);
+ ex = ctor.newInstance(message, cause);
+ } catch (NoSuchMethodException e1) {
+ try {
ctor = exceptionClass.getConstructor(String.class);
ex = ctor.newInstance(message);
+ } catch (NoSuchMethodException e2) {
+ try {
+ ctor = exceptionClass.getConstructor(Throwable.class);
+ ex = ctor.newInstance(cause);
+ } catch (NoSuchMethodException e3) {
+ ctor = exceptionClass.getConstructor();
+ ex = ctor.newInstance();
+ }
}
- } catch (NoSuchMethodException e2) {
+ }
+ } else {
+ try {
+ // FIXME: What about if the faultBeanClass is a subclass of the argument type?
+ ctor = exceptionClass.getConstructor(String.class, faultBeanClass, Throwable.class);
+ ex = ctor.newInstance(message, faultInfo, cause);
+ } catch (NoSuchMethodException e1) {
try {
- ctor = exceptionClass.getConstructor(String.class, Throwable.class);
- ex = ctor.newInstance(message, cause);
- populateException(ex, faultInfo);
- } catch (NoSuchMethodException e3) {
+ ctor = exceptionClass.getConstructor(String.class, faultInfo.getClass());
+ ex = ctor.newInstance(message, faultInfo);
+ } catch (NoSuchMethodException e2) {
try {
- ctor = exceptionClass.getConstructor(String.class);
- ex = ctor.newInstance(message);
+ ctor = exceptionClass.getConstructor(String.class, Throwable.class);
+ ex = ctor.newInstance(message, cause);
populateException(ex, faultInfo);
- } catch (NoSuchMethodException e4) {
- ctor = exceptionClass.getConstructor();
- if (ctor != null) {
- ex = ctor.newInstance();
+ } catch (NoSuchMethodException e3) {
+ try {
+ ctor = exceptionClass.getConstructor(String.class);
+ ex = ctor.newInstance(message);
populateException(ex, faultInfo);
- } else {
- ex = new FaultException(message, faultInfo, cause);
+ } catch (NoSuchMethodException e4) {
+ try {
+ ctor = exceptionClass.getConstructor();
+ if (ctor != null) {
+ ex = ctor.newInstance();
+ populateException(ex, faultInfo);
+ } else {
+ ex = new FaultException(message, faultInfo, cause);
+ }
+ } catch (NoSuchMethodException e5) {
+ ctor = exceptionClass.getConstructor();
+ ex = ctor.newInstance();
+ }
}
}
}
}
}
+
return ex;
}