[ http://issues.apache.org/jira/browse/TUSCANY-41?page=all ]
     
Jean-Sebastien Delfino closed TUSCANY-41:
-----------------------------------------


> Wire builder algorithm uses incorrect scope container
> -----------------------------------------------------
>
>          Key: TUSCANY-41
>          URL: http://issues.apache.org/jira/browse/TUSCANY-41
>      Project: Tuscany
>         Type: Bug

>   Components: Java SCA Core
>  Environment: Linux
>     Reporter: Jean-Sebastien Delfino

>
> This problem is currently blocking the External Web Services integration work.
> A target wire builder implements the following method:
> public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, 
> Class targetType, boolean downScope, ScopeContext targetScopeContext) throws 
> BuilderConfigException;
> My understanding is that the target scope container (i.e. the scope of the 
> target of the wire) should be passed to this method. Instead I am receiving 
> the scope associated with the source of the wire.
> It looks like a number of test cases are passing right now because they're 
> using matching scopes on both ends of the wire. To reproduce the problem 
> simply change o.a.t.container.java.mock.MockModuleFactory as follows: 
>     public static Module createModuleWithExerntalService() throws Exception {
>         Component sourceComponent = 
> MockAssemblyFactory.createComponent("source", 
> HelloWorldClient.class,Scope.MODULE);
> to
>     public static Module createModuleWithExerntalService() throws Exception {
>         Component sourceComponent = 
> MockAssemblyFactory.createComponent("source", 
> HelloWorldClient.class,Scope.INSTANCE);
> This will cause the following exception in 
> o.a.t.container.java.mock.binding.foo.FooTargetInvoker (because the 
> TargetInvoker will not find anything into the - incorrect - scope container).
> java.lang.NullPointerException
>       at 
> org.apache.tuscany.container.java.mock.binding.foo.FooTargetInvoker.invokeTarget(FooTargetInvoker.java:51)
>       at 
> org.apache.tuscany.container.java.mock.binding.foo.FooTargetInvoker.invoke(FooTargetInvoker.java:71)
>       at 
> org.apache.tuscany.core.invocation.impl.InvokerInterceptor.invoke(InvokerInterceptor.java:39)
>       at 
> org.apache.tuscany.container.java.invocation.mock.MockSyncInterceptor.invoke(MockSyncInterceptor.java:34)
>       at 
> org.apache.tuscany.core.invocation.jdk.JDKInvocationHandler.invoke(JDKInvocationHandler.java:79)
>       at $Proxy5.hello(Unknown Source)
>       at 
> org.apache.tuscany.container.java.mock.components.HelloWorldClient.hello(HelloWorldClient.java:35)
>       at 
> org.apache.tuscany.container.java.integration.binding.JavaToExternalServiceTestCase.testJavaToES(JavaToExternalServiceTestCase.java:94)
>       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 junit.framework.TestCase.runTest(TestCase.java:154)
>       at junit.framework.TestCase.runBare(TestCase.java:127)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:118)
>       at junit.framework.TestSuite.runTest(TestSuite.java:208)
>       at junit.framework.TestSuite.run(TestSuite.java:203)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to