You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Thomas Darbois <Th...@edifixio.com> on 2008/08/07 14:43:07 UTC

Tuscany RMI bindings Java Implementation and Exceptions.

I've seen something that troubles me in the way of dealing with exception.


Let say I've a webapplication A (SCA component) that asks something on B (a standalone SCA component) which will interrogate C (a standalone SCA component) all of them communicating with Tuscany SCA RMI bindings.

C is raising an exception called ElementNotFoundException (an exception that is known by C and B). B catches the exception and throws a new exception called ElementNotInTheComponentException (known only by A and B) created with the constructor of ElementNotInTheComponentException (String message, Exception e) with e =  the caught exception.

When A received the exception, tuscany is decocing the exception and is raising an exception because he can't find ElementNotFoundException (which is not in the classpath because the end user should not depend on this exception).
java.lang.reflect.UndeclaredThrowableException
            at $Proxy11.getElementRMIService (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.getElementRMIService (Unknown Source)
            at ServiceImpl.getElementService (ServiceImpl.java:104)
            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.getElementService(Unknown Source)
            at ElementAction.execute(ElementAction.java:102)
            at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
            at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
            at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
            at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
            at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
            at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
            at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
            at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.doFilter(TuscanyServletFilter.java:98)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Unknown Source)
Caused by: java.rmi.UnexpectedException: unexpected exception; nested exception is:
            java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
            java.lang.ClassNotFoundException: ElementNotFoundException  (no security manager: RMI class loader disabled)
            at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
            at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
            ... 50 more
Caused by: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
            java.lang.ClassNotFoundException: ElementNotFoundException (no security manager: RMI class loader disabled)
            at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
            at sun.rmi.server.UnicastRef.invoke(Unknown Source)
            ... 52 more
Caused by: java.lang.ClassNotFoundException: (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)
            ... 54 more


In case A has in its classpath the exception raised by C, everything works perfectly fine.


Tomas Darbois
Edifixio Grenoble - Projet ScorWare
04 76 29 89 27
thomas.darbois@edifixio.com<ma...@edifixio.com>