You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2011/03/09 09:11:59 UTC
[jira] Created: (FELIX-2876) element not generated when
name is missing
<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
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"/>
<reference interface="org.osgi.service.log.LogService" cardinality="1..1" policy="static"/>
</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
[jira] Commented: (FELIX-2876) element not generated
when name is missing
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004473#comment-13004473 ]
Carsten Ziegeler commented on FELIX-2876:
-----------------------------------------
Updated the reference validation to check for null name and use the interface class name instead when searching for bind/unbind methods. Revision 1079744
> <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.1.0
>
>
> 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
[jira] Closed: (FELIX-2876) element not generated when
name is missing
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler closed FELIX-2876.
-----------------------------------
> <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.1.0
>
>
> 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
[jira] Assigned: (FELIX-2876) element not generated
when name is missing
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler reassigned FELIX-2876:
---------------------------------------
Assignee: Carsten Ziegeler
> <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
>
> 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
[jira] Updated: (FELIX-2876) element not generated when
name is missing
Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Felix Meschberger updated FELIX-2876:
-------------------------------------
Description:
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)
was:
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"/>
<reference interface="org.osgi.service.log.LogService" cardinality="1..1" policy="static"/>
</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)
> <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
>
> 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
[jira] Resolved: (FELIX-2876) element not generated
when name is missing
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler resolved FELIX-2876.
-------------------------------------
Resolution: Fixed
I think everything is working now
> <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.1.0
>
>
> 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
[jira] Resolved: (FELIX-2876) element not generated
when name is missing
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ 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
[jira] Reopened: (FELIX-2876) element not generated
when name is missing
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler reopened FELIX-2876:
-------------------------------------
The above commit does not handle bind/unbind method generation and check
> <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.1.0
>
>
> 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