[
https://issues.apache.org/jira/browse/TUSCANY-2454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610227#action_12610227
]
Mark Combellack commented on TUSCANY-2454:
------------------------------------------
The problem with the code is the way that it uses the Binding URI to look up
the target Component and target Service. The code currently assumes that the
Binding URI is one of the following forms:
ComponentName/ServiceName
CompositeName/ComponentName/ServiceName
However, if a Component only has one Service, the Service Name can be omitted.
So a valid Binding URI to a Component that has only one Service of:
CompositeName/ComponentName
Is being treated as Component URI of CompositeName and Service Name of
ComponentName. This is wrong.
The code should treat the above Binding URI to be component URI of
CompositeName/ComponentName and no Service Name
The offending code is in the deserialization code of the following classes:
core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceImpl.java
core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceImpl.java
> Deserialization of a CallableReference fails when the reference refers to a
> nested composite
> --------------------------------------------------------------------------------------------
>
> Key: TUSCANY-2454
> URL: https://issues.apache.org/jira/browse/TUSCANY-2454
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Environment: Tuscany trunk SVN revision 673670
> Linux
> Reporter: Mark Combellack
> Assignee: Mark Combellack
> Fix For: Java-SCA-Next
>
>
> If you have a ServiceReference that refers to a nested Composite, Serializing
> and then Deserializing the ServiceReference will result in the
> ServiceReference.getService() failing to create a valid proxy that when
> invoked will throw ServiceUnavailableException.
> I've extended the serialization itest to illustrate this problem. The
> exception you get is:
> org.osoa.sca.ServiceUnavailableException: Unable to create SCA binding
> invoker for local target default reference nestedConversationalService
> (bindingURI=/NestedComponent/ConversationalNestedComponent
> operation=getConversationID)
> at
> org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvider.createInvoker(RuntimeSCAReferenceBindingProvider.java:193)
> at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addReferenceBindingInterceptor(RuntimeWireImpl.java:228)
> at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:167)
> at
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:109)
> at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvocationChain(JDKInvocationHandler.java:243)
> at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:148)
> at $Proxy16.getConversationID(Unknown Source)
> at
> org.apache.tuscany.sca.itest.servicereference.SCAManagedConversationalClientImpl.doTestSerializeConversationalServiceReference(SCAManagedConversationalClientImpl.java:99)
> at
> org.apache.tuscany.sca.itest.servicereference.SCAManagedConversationalClientImpl.testSerializeNestedConversationalServiceReference(SCAManagedConversationalClientImpl.java:70)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> 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 $Proxy15.testSerializeNestedConversationalServiceReference(Unknown
> Source)
> at
> org.apache.tuscany.sca.itest.servicereference.SerializeServiceReferenceTestCase.testSerializeNestedConversationalServiceReferenceInsideSCA(SerializeServiceReferenceTestCase.java:115)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
> at
> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
> at
> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
> at
> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
> at
> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
> at
> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.