felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (FELIX-2876) <reference> element not generated when name is missing
Date Wed, 09 Mar 2011 10:04:59 GMT

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

Carsten Ziegeler resolved FELIX-2876.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: scr generator 1.0.2
                   scr ant task 1.1.0
                   maven-scr-plugin-1.7.0

References without a name where completly ignored. I've now changed the code according to
the description above in revision 1079719

> <reference> element not generated when name is missing
> ------------------------------------------------------
>
>                 Key: FELIX-2876
>                 URL: https://issues.apache.org/jira/browse/FELIX-2876
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions:  maven-scr-plugin-1.6.0
>            Reporter: Felix Meschberger
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.7.0, scr ant task 1.1.0, scr generator 1.0.2
>
>
> I have the following class:
>     @Component(specVersion = "1.1")
>     @Service(Servlet.class)
>     @Reference(referenceInterface = LogService.class, strategy = ReferenceStrategy.LOOKUP)
>     public class Test extends HttpServlet {
>     }
> Running this through the Maven SCR Plugin, I would expect this descriptor:
>     <?xml version="1.0" encoding="UTF-8"?>
>     <components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
>         <scr:component enabled="true" name="test.Test">
>             <implementation class="test.Test"/>
>             <service servicefactory="false">
>                 <provide interface="javax.servlet.Servlet"/>
>             </service>
>             <property name="service.pid" value="test.Test"/>
>             <reference interface="org.osgi.service.log.LogService" cardinality="1..1"
policy="static"/>
>         </scr:component>
>     </components>
> what I get is the following descriptor without the <reference> element
>     <?xml version="1.0" encoding="UTF-8"?>
>     <components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
>         <scr:component enabled="true" name="test.Test">
>             <implementation class="test.Test"/>
>             <service servicefactory="false">
>                 <provide interface="javax.servlet.Servlet"/>
>             </service>
>             <property name="service.pid" value="test.Test"/>
>         </scr:component>
>     </components>
> Adding the "name" attribute to the @Reference tag properly generates <reference>
element, though.
> IMHO this is false in multiple ways:
>   * There is no log message indicating this omission
>   * According to the DS 1.1 spec, the name attribute is optional; thus a <reference>
element without name must be generated
>   * If I set specVersion="1.0" in the @Component tag, an error should be generated for
the missing name tag (because the name tag is required in DS 1.0)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message