diff options
Diffstat (limited to 'java/sca/modules/binding-corba-runtime/src')
5 files changed, 13 insertions, 9 deletions
diff --git a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaInvoker.java b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaInvoker.java index dd06fdfdad..43c471d3bc 100644 --- a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaInvoker.java +++ b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaInvoker.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.binding.corba.impl; +import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException; import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaRequest; import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaResponse; import org.apache.tuscany.sca.interfacedef.DataType; @@ -60,8 +61,10 @@ public class CorbaInvoker implements Invoker { } DynaCorbaResponse response = request.invoke(); msg.setBody(response.getContent()); - } catch (Exception e) { + } catch (RequestConfigurationException e) { throw new ServiceRuntimeException(e); + } catch (Exception e) { + msg.setFaultBody(e); } return msg; } diff --git a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java index 9d4a93d1ac..ec752a1638 100644 --- a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java +++ b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java @@ -59,6 +59,7 @@ public class CorbaServiceBindingProvider implements ServiceBindingProvider { try { this.orb = host.createORB(binding.getHost(), binding.getPort(), false); servant = new DynaCorbaServant(service, binding); + servant.setIds(new String[] {binding.getId()}); host.registerServant(orb, binding.getName(), servant); } catch (Exception e) { throw new ServiceRuntimeException(e); diff --git a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java index 6f7a736410..cece057baa 100644 --- a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java +++ b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java @@ -88,11 +88,13 @@ public class DynaCorbaServant extends ObjectImpl implements InvokeHandler { } public void setIds(String[] ids) { - if (ids != null) { - this.ids = ids; - } else { - this.ids = DEFAULT_IDS; + for (int i = 0; i < ids.length; i++) { + if (ids[i] == null || ids[i].length() == 0) { + this.ids = DEFAULT_IDS; + return; + } } + this.ids = ids; } public OutputStream _invoke(String method, InputStream in, ResponseHandler rh) { diff --git a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeCreator.java b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeCreator.java index e0f60cc2bb..4a24e66778 100644 --- a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeCreator.java +++ b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/TypeTreeCreator.java @@ -316,7 +316,7 @@ public class TypeTreeCreator { } } catch (NoSuchMethodException e) { } - if (!isFromIntMethod && !isValueMethod) { + if (!isFromIntMethod || !isValueMethod) { return false; } /* @@ -345,6 +345,7 @@ public class TypeTreeCreator { /** * Tells whether given class is corba user exception + * * @param forClass * @return */ diff --git a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/Utils.java b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/Utils.java index b9d07db61c..4c1467d3c3 100644 --- a/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/Utils.java +++ b/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/types/util/Utils.java @@ -29,9 +29,6 @@ public class Utils { public static String getExceptionId(Class<?> forClass) { String result = forClass.getName().replace('.', '/'); result = result.replaceAll("Package", ""); - if (result.endsWith("Exception")) { - result = result.substring(0, result.length() - "Exception".length()); - } result = "IDL:" + result + ":1.0"; return result; } |