Problem when more than one component has the same implementation.composite and 
that this composite has exposed references
-------------------------------------------------------------------------------------------------------------------------

                 Key: TUSCANY-2982
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2982
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Assembly Model
    Affects Versions: Java-SCA-1.4
         Environment: Linux / JavaSE-1.6
            Reporter: Julien Bigot


When in a hierarchy of instantiated components, two components (even not at the 
same level of the hierarchy) have the same implementation.composite and that 
the referenced composite has a reference promoting one (or more) reference of 
its internal components, connecting these composite references leads to a 
NullPointerException.

For example:

A.componentType
 |-> reference refA
 |-> service servA

B.composite
 |-> component a: A
 |-> reference refB = a/refA

C.composite
 |-> component b: B
 |-> reference refC = b/refB

D.composite
 |-> component a: A
 |-> component b: B
 |-> component c: C
 |-> wire a/servA <-> b/refB
 |-> wire a/servA <-> c/refC

instantiation of D leads to the following hierarchy

D/
 |->a
 |->b/
     |->a
 |->c/
    |->b/
        |->a

There are two instances of B (D/b & D/c/b) and these two instances have a 
reference (refB) promoting a reference of an internal component (a/refA), this 
results in the following NullPointerException :

 java.lang.NullPointerException
        at 
org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl.checkCompatibility(InterfaceContractMapperImpl.java:155)
        at 
org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl.isCompatible(InterfaceContractMapperImpl.java:271)
        at 
org.apache.tuscany.sca.assembly.builder.impl.BaseWireBuilderImpl.connectWires(BaseWireBuilderImpl.java:940)
        at 
org.apache.tuscany.sca.assembly.builder.impl.BaseWireBuilderImpl.wireComponentReferences(BaseWireBuilderImpl.java:112)

from my initial investigations, this seems somehow related to the fact that 
when cloned, CompositeReferenceImpl's do not clone their promotedReferences 
attribute, but rather copy it. I didn't manage to get further however.

-- 
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