[ 
https://issues.apache.org/jira/browse/TUSCANY-2545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

tomas darbois updated TUSCANY-2545:
-----------------------------------

    Attachment: calculator-exception.rar

Here is the example and the exception seen from the client : 

3 + 2=5.0
3 - 2=1.0
3 * 2=6.0
3 / 2=1.5
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
        at $Proxy7.divide(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at 
org.apache.tuscany.sca.binding.rmi.RMIReferenceInvoker.invokeTarget(RMIReferenceInvoker.java:79)
        at 
org.apache.tuscany.sca.binding.rmi.RMIReferenceInvoker.invoke(RMIReferenceInvoker.java:56)
        at 
org.apache.tuscany.sca.extension.helper.impl.InvokerProxy.invoke(BindingsActivator.java:256)
        at 
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
        at $Proxy6.divide(Unknown Source)
        at calculator.ClientServiceImpl.divide(ClientServiceImpl.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at 
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132)
        at 
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
        at $Proxy5.divide(Unknown Source)
        at calculator.CalculatorClient.main(CalculatorClient.java:39)
Caused by: java.rmi.UnexpectedException: unexpected exception; nested exception 
is: 
        java.rmi.UnmarshalException: Error unmarshaling return; nested 
exception is: 
        java.lang.ClassNotFoundException: calculator.ZeroException (no security 
manager: RMI class loader disabled)
        at 
java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
        at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
        ... 23 more
Caused by: java.rmi.UnmarshalException: Error unmarshaling return; nested 
exception is: 
        java.lang.ClassNotFoundException: calculator.ZeroException (no security 
manager: RMI class loader disabled)
        at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
        at sun.rmi.server.UnicastRef.invoke(Unknown Source)
        ... 25 more
Caused by: java.lang.ClassNotFoundException: calculator.ZeroException (no 
security manager: RMI class loader disabled)
        at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
        at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
        at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
        at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
        at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
        at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        ... 27 more


> Exception and RMI binding :  propagating an exception.
> ------------------------------------------------------
>
>                 Key: TUSCANY-2545
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2545
>             Project: Tuscany
>          Issue Type: Bug
>    Affects Versions: Java-SCA-1.3
>         Environment: Windows 2000; JDK 1.6_05 or JDK 1.5_015, Maven 2.0.9
>            Reporter: tomas darbois
>         Attachments: calculator-exception.rar
>
>
> Let's say we have a Calculator.
> The client connects through SCA and binding RMI to the calculator. The 
> calculator connects to the "divider"  through SCA and binding RMI.
> The divider raise a ZeroException (an exception that is declared as being 
> thrown by divide method, exception known only by Calculator and Divider ) he 
> found that he has the divisor = 0 and didn't try to do the computation and 
> instead throws this exception.
> Calculator catches the exception and raise a new exception 
> ServiceFatalException known by Client and Calculator (code = << throw new 
> ServiceFatalException( "A string message", e); >>     where e is the 
> ZeroException that has been caught).
> Client is trying to catch the exception ServiceFatalException.
> This architecture is failing because the RMI binding in client part tries to 
> find the class "ZeroException" that is not defined in that environment. 
> In case we add in the classpath the class ZeroException, he successfully 
> recovers a ServiceFatalException.
> I'm joining an example containing the 3 elements (the 2 standalone server and 
> the client).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to