[ 
https://issues.apache.org/jira/browse/TUSCANY-2193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585135#action_12585135
 ] 

Scott Kurz commented on TUSCANY-2193:
-------------------------------------

I found the problem.    

In CompositeConfigurationBuilderImpl.reconcileReferences() we do a check to see 
if we want an incompatible intf warning:

                // Reconcile interface
                if (componentReference.getInterfaceContract() != null) {
                    if 
(!componentReference.getInterfaceContract().equals(reference
                        .getInterfaceContract())) {
                        if 
(!interfaceContractMapper.isCompatible(reference.getInterfaceContract(),
                                                                  
componentReference
                                                                      
.getInterfaceContract())) {
                            warning("Component reference interface incompatible 
with reference interface: " +.......

In the case I described above, we are going to have a non-null IC from the 
component reference (the WSDL IC).  However, the reference IC wlil still be 
null at this point.   (The reason seems to be that the reference IC on the 
composite impl does not get set until CompositeWireBuilderImpl.wireComposite).

So I'll leave it up to others whether it's best to put a null guard before 
calling the IC mapper or if we should look to put a guard in the IC mapper impl 
itself.

> NPE when configuring WSDL interface on component ref when the component has a 
> Composite impl
> --------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-2193
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2193
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core Runtime
>            Reporter: Scott Kurz
>            Priority: Minor
>
> I noticed this with a more complicated example.  
> To reproduce more simply maybe, go to the SVN dir:  sca/itest/recursive
> and modify BComposite.composite so it looks like:
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
>     targetNamespace="http://sample";
>     xmlns:sample="http://sample";
>     name="BComposite">
>    ....
>     <component name="BComponent">
>         <implementation.composite name="sample:CComposite"/>
>         <reference name="PromotedRefX">
>                <interface.wsdl interface="http://blah#wsdl.interface(Blah)" />
>         </reference>
>    ....
> Note that you can put any old WSDL in there.   You shouldn't get far enough 
> for it to even matter.  
> You'll hit errors like:
> 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.CompositeConfigurationBuilderImpl.reconcileReferences(CompositeConfigurationBuilderImpl.java:527)
>       at 
> org.apache.tuscany.sca.assembly.builder.impl.CompositeConfigurationBuilderImpl.configureComponents(CompositeConfigurationBuilderImpl.java:250)
>       at 
> org.apache.tuscany.sca.assembly.builder.impl.CompositeConfigurationBuilderImpl.configureComponents(CompositeConfigurationBuilderImpl.java:85)
>       at 
> org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl.build(CompositeBuilderImpl.java:97)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to