[ 
https://issues.apache.org/jira/browse/TUSCANY-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Raymond Feng resolved TUSCANY-1309.
-----------------------------------

    Resolution: Invalid

If the reference/service under the <component> doesn't match what are declared 
(or introspected) on the componentType, we produce a warning. In this case, the 
variable is not a SCA reference and no injection happens. So it's default to 
null and NPE is a user error.

> NPE if SCDL uses component reference that is not defined consistently in the 
> implementation
> -------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1309
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1309
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Assembly Model
>    Affects Versions: Java-SCA-0.90
>         Environment: Win XP
>            Reporter: Simon Laws
>            Assignee: Jean-Sebastien Delfino
>            Priority: Minor
>             Fix For: Java-SCA-Next
>
>
> For example,
> public class AlertsServiceImpl {
>     private RSSCheckerService    rssChecker;
>     
>     private AlertsSourcesService alertsSources;
>     @Reference
>     public void setRssChecker(RSSCheckerService rssChecker) {
>         this.rssChecker = rssChecker;
>     }
>     
>     // missing explicit reference defintion for alertsSources. 
>     ...
> }
> Then the SCDL...
>     <component name="AlertsServiceComponent">
>         <implementation.java 
> class="org.apache.tuscany.sca.samples.aggregator.AlertsServiceImpl" />
>         <reference name="rssChecker" target="RSSCheckerComponent"/>
>         <reference name="alertsSources" 
> target="AlertsSourcesServiceComponent"/>
>     </component>
> Results in NPE

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