You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Andrei Pozolotin (JIRA)" <ji...@apache.org> on 2011/05/21 04:23:47 UTC
[jira] [Created] (FELIX-2963) scr annotations @Activate @Deactivate
@Modified are not detected with class inheritance
scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
---------------------------------------------------------------------------------------
Key: FELIX-2963
URL: https://issues.apache.org/jira/browse/FELIX-2963
Project: Felix
Issue Type: Bug
Components: Declarative Services (SCR), Maven SCR Plugin
Affects Versions: scr-1.6.0, maven-scr-plugin-1.7.0
Reporter: Andrei Pozolotin
// 1) when I use a base component with scr lifecycle annotations:
@Component(componentAbstract = true)
public abstract class BasePluginEDT {
@Activate
protected final void activateEDT(final Map<String, String> config) {
@Deactivate
protected final void deactivateEDT(final Map<String, String> config) {
@Modified
protected final void modifiedEDT(final Map<String, String> config) {
// 2) which is inherited by a derived component:
@Service
@Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
// 3) then xml for the derived component does not show annotated methods from the parent
<scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
<implementation class="com.ddfplus.core.space.BucketPlugin"/>
<service servicefactory="false">
<provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
</service>
<property name="service.pid" type="String" value="barchart.service.space"/>
<reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
<reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
</scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler reassigned FELIX-2963:
---------------------------------------
Assignee: Carsten Ziegeler
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR), Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr-1.6.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FELIX-2963) scr annotations @Activate @Deactivate
@Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler updated FELIX-2963:
------------------------------------
Affects Version/s: scr ant task 1.0.0
scr ant task 1.1.2
Fix Version/s: scr ant task 1.1.4
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, maven-scr-plugin-1.7.2, scr ant task 1.0.0, scr ant task 1.1.2, scr generator 1.1.0, scr generator 1.1.2
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.4, scr ant task 1.1.4, scr generator 1.1.4
>
> Attachments: scr-bug2.zip
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049440#comment-13049440 ]
Andrei Pozolotin commented on FELIX-2963:
-----------------------------------------
probably again has to do with exploded jar:
this error happens when building derived project only in eclipse with m2e:
6/14/11 4:24:32 PM CDT: Maven Builder: AUTO_BUILD
6/14/11 4:24:32 PM CDT: [INFO] Using 'UTF-8' encoding to copy filtered resources.
6/14/11 4:24:32 PM CDT: [INFO] Copying 8 resources
6/14/11 4:24:32 PM CDT: [INFO] Copying 8 resources
6/14/11 4:24:32 PM CDT: [WARN] Unable to read SCR descriptor file from JAR File /home/user1/Workspaces/barchart-3.6-work/barchart-platform/barchart-backend/barchart-backend-api/target/classes at OSGI-INF/serviceComponents.xml
6/14/11 4:24:32 PM CDT: [WARN] Unable to read SCR descriptor file from JAR File /home/user1/Workspaces/barchart-3.6-work/barchart-platform/barchart-backend/barchart-backend-api/target/classes at OSGI-INF/serviceComponents.xml
6/14/11 4:24:33 PM CDT: [INFO] Writing abstract service descriptor /home/user1/Workspaces/barchart-3.6-work/barchart-platform/barchart-plugin-core/target/classes/OSGI-INF/scr-plugin/scrinfo.xml with 22 entries.
6/14/11 4:24:33 PM CDT: [INFO] Generating 22 Service Component Descriptors to /home/user1/Workspaces/barchart-3.6-work/barchart-platform/barchart-plugin-core/target/classes/OSGI-INF/serviceComponents.xml
6/14/11 4:24:33 PM CDT: [INFO] Using 'UTF-8' encoding to copy filtered resources.
6/14/11 4:24:33 PM CDT: [INFO] Copying 0 resource
this project contains parent:
6/14/11 4:24:32 PM CDT: [WARN] Unable to read SCR descriptor file from JAR File /home/user1/Workspaces/barchart-3.6-work/barchart-platform/barchart-backend/barchart-backend-api/target/classes at OSGI-INF/serviceComponents.xml
this project contains derived:
6/14/11 4:24:33 PM CDT: [INFO] Generating 22 Service Component Descriptors to /home/user1/Workspaces/barchart-3.6-work/barchart-platform/barchart-plugin-core/target/classes/OSGI-INF/serviceComponents.xml
and in the parent - the serviceComponents.xml is present, but it contains no entries for @Component(componentAbstract = true)
(only for some other non-abstract components)
so, basically scr plugin is either not able to find parent abstarct component descriptor or can not read parent xml at all
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FELIX-2963) scr annotations @Activate @Deactivate
@Modified are not detected with class inheritance
Posted by "Chetan Mehrotra (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chetan Mehrotra updated FELIX-2963:
-----------------------------------
Attachment: scr-bug2.zip
Sample Maven project. If you build it then you can see the serviceComponents.xml in the moduleB has a reference entry (inherited from parent) but no entry for activate method.
However if you see scrinfo.xml in moduleA then it has entry for activate method
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
> Attachments: scr-bug2.zip
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (FELIX-2963) scr annotations
@Activate @Deactivate @Modified are not detected with class inheritance
Posted by "Chetan Mehrotra (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082205#comment-13082205 ]
Chetan Mehrotra edited comment on FELIX-2963 at 8/10/11 8:50 AM:
-----------------------------------------------------------------
I am facing the same issue. I tried to debug it and following flow is happening
1. org.apache.felix.scrplugin.SCRDescriptorGenerator#checkLifecycleMethod is called with "activate"
2. It invokes the desc.getTagByName( Constants.COMPONENT )
3. The desc in this case is org.apache.felix.scrplugin.tags.cl.ClassLoaderJavaClassDescription#getTagByName
This method implementation is currently empty. However the component field has the required activate method name populated. So may be we need to use logic as done in getTagsByName
was (Author: chetanm):
I am facing the same issue. I tried to debug it and following flow is happening
# org.apache.felix.scrplugin.SCRDescriptorGenerator#checkLifecycleMethod is called with "activate"
# It invokes the desc.getTagByName( Constants.COMPONENT )
# The desc in this case is org.apache.felix.scrplugin.tags.cl.ClassLoaderJavaClassDescription#getTagByName
This method implementation is currently empty. However the component field has the require activate method name populated
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049442#comment-13049442 ]
Andrei Pozolotin commented on FELIX-2963:
-----------------------------------------
idea: another possible cause:
I use these method names in derived:
protected abstract void activate(Map<String, String> config)
throws Exception;
protected abstract void deactivate(Map<String, String> config)
throws Exception;
protected abstract void modified(Map<String, String> config)
throws Exception;
chances are, since they are default names of these methods, (only w/o annotations)
they might overshadow something somewhere :-)
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13083075#comment-13083075 ]
Carsten Ziegeler commented on FELIX-2963:
-----------------------------------------
Hi Chetan,
thanks for the information and sample project. I've implemented the getTagByName method in revision 1156580 and at least your test project runs fine now. I think we should give it some test drives before closing this.
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, maven-scr-plugin-1.7.2, scr ant task 1.0.0, scr ant task 1.1.2, scr generator 1.1.0, scr generator 1.1.2
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.4, scr ant task 1.1.4, scr generator 1.1.4
>
> Attachments: scr-bug2.zip
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053701#comment-13053701 ]
Carsten Ziegeler commented on FELIX-2963:
-----------------------------------------
Hi Andrei, can you turn on debug logging - this should show the exception when trying to read the serviceComponents.xml
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045324#comment-13045324 ]
Carsten Ziegeler commented on FELIX-2963:
-----------------------------------------
Thanks for the test project! I've committed a patch in revision 1132907 - I think everything is working fine. Could you please verify this?
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FELIX-2963) scr annotations @Activate @Deactivate
@Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler updated FELIX-2963:
------------------------------------
Affects Version/s: maven-scr-plugin-1.7.2
scr generator 1.1.2
Fix Version/s: (was: scr generator 1.1.2)
(was: maven-scr-plugin-1.7.2)
scr generator 1.1.4
maven-scr-plugin-1.7.4
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, maven-scr-plugin-1.7.2, scr generator 1.1.0, scr generator 1.1.2
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.4, scr generator 1.1.4
>
> Attachments: scr-bug2.zip
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (FELIX-2963) scr annotations @Activate @Deactivate
@Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (Closed) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler closed FELIX-2963.
-----------------------------------
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, maven-scr-plugin-1.7.2, scr ant task 1.0.0, scr ant task 1.1.2, scr generator 1.1.0, scr generator 1.1.2
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.4, scr ant task 1.1.4, scr generator 1.1.4
>
> Attachments: scr-bug2.zip
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (FELIX-2963) scr annotations
@Activate @Deactivate @Modified are not detected with class inheritance
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049431#comment-13049431 ]
Andrei Pozolotin edited comment on FELIX-2963 at 6/14/11 9:19 PM:
------------------------------------------------------------------
wow! getting close!
(after update to the latest snapshot of scr plugin)
it DOES work, when @Component(componentAbstract = true) is located in the same bundle as derived component;
but it does NOT work if the parent is located in a different bundle; thank you.
was (Author: andrei.pozolotin):
wow! getting close!
it DOES work, when @Component(componentAbstract = true) is located in the same bundle as derived component;
but it does NOT work if the parent is located in a different bundle; thank you.
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044803#comment-13044803 ]
Carsten Ziegeler commented on FELIX-2963:
-----------------------------------------
Can you please strip down the example and either attach the complete project to this bug or send it to me directly?
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR), Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr-1.6.0
> Reporter: Andrei Pozolotin
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045988#comment-13045988 ]
Andrei Pozolotin commented on FELIX-2963:
-----------------------------------------
still does not work for me; probably I have wrong snapshot: maven-scr-plugin-1.7.1-20110517.073734-2.jar (latest from the repo) ?
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Chetan Mehrotra (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082205#comment-13082205 ]
Chetan Mehrotra commented on FELIX-2963:
----------------------------------------
I am facing the same issue. I tried to debug it and following flow is happening
# org.apache.felix.scrplugin.SCRDescriptorGenerator#checkLifecycleMethod is called with "activate"
# It invokes the desc.getTagByName( Constants.COMPONENT )
# The desc in this case is org.apache.felix.scrplugin.tags.cl.ClassLoaderJavaClassDescription#getTagByName
This method implementation is currently empty. However the component field has the require activate method name populated
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (FELIX-2963) scr annotations @Activate @Deactivate
@Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler closed FELIX-2963.
-----------------------------------
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FELIX-2963) scr annotations @Activate @Deactivate
@Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler updated FELIX-2963:
------------------------------------
Component/s: (was: Declarative Services (SCR))
Affects Version/s: (was: scr-1.6.0)
scr generator 1.1.0
Fix Version/s: scr generator 1.1.2
maven-scr-plugin-1.7.2
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler resolved FELIX-2963.
-------------------------------------
Resolution: Fixed
I think this is fixed now. If not we can track the new problem with a new issue
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler resolved FELIX-2963.
-------------------------------------
Resolution: Fixed
Thanks Chetan, so I set this to resolved :)
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, maven-scr-plugin-1.7.2, scr ant task 1.0.0, scr ant task 1.1.2, scr generator 1.1.0, scr generator 1.1.2
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.4, scr ant task 1.1.4, scr generator 1.1.4
>
> Attachments: scr-bug2.zip
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049431#comment-13049431 ]
Andrei Pozolotin commented on FELIX-2963:
-----------------------------------------
wow! getting close!
it DOES work, when @Component(componentAbstract = true) is located in the same bundle as derived component;
but it does NOT work if the parent is located in a different bundle; thank you.
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler reopened FELIX-2963:
-------------------------------------
Reopening
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Chetan Mehrotra (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13085573#comment-13085573 ]
Chetan Mehrotra commented on FELIX-2963:
----------------------------------------
Thanks Carsten for the fix. I verified the fix by setting org.apache.felix:org.apache.felix.scr.generator:1.1.3-SNAPSHOT as the dependency on maven-bundle-plugin and it works as expected
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, maven-scr-plugin-1.7.2, scr ant task 1.0.0, scr ant task 1.1.2, scr generator 1.1.0, scr generator 1.1.2
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.4, scr ant task 1.1.4, scr generator 1.1.4
>
> Attachments: scr-bug2.zip
>
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-2963) scr annotations @Activate
@Deactivate @Modified are not detected with class inheritance
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044942#comment-13044942 ]
Andrei Pozolotin commented on FELIX-2963:
-----------------------------------------
Carsten:
here is a project:
https://github.com/carrot-garden/carrot-bugger/tree/master/carrot-bug-FELIX-2963-001
base class:
https://github.com/carrot-garden/carrot-bugger/blob/master/carrot-bug-FELIX-2963-001/src/main/java/bench/CompBase.java
class inherited from base:
https://github.com/carrot-garden/carrot-bugger/blob/master/carrot-bug-FELIX-2963-001/src/main/java/bench/CompInherited.java
result xml:
https://github.com/carrot-garden/carrot-bugger/blob/master/carrot-bug-FELIX-2963-001/example/serviceComponents.xml
steps to reproduce:
https://github.com/carrot-garden/carrot-bugger/blob/master/carrot-bug-FELIX-2963-001/launch/reproduce.sh
problem:
activate / deactivate annotations are present on the base class, but they do not make it into xml when inherited;
thanks again,
Andrei.
> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
> Key: FELIX-2963
> URL: https://issues.apache.org/jira/browse/FELIX-2963
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR), Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.7.0, scr-1.6.0
> Reporter: Andrei Pozolotin
> Assignee: Carsten Ziegeler
>
> // 1) when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> @Activate
> protected final void activateEDT(final Map<String, String> config) {
> @Deactivate
> protected final void deactivateEDT(final Map<String, String> config) {
> @Modified
> protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
> <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
> <implementation class="com.ddfplus.core.space.BucketPlugin"/>
> <service servicefactory="false">
> <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
> </service>
> <property name="service.pid" type="String" value="barchart.service.space"/>
> <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService" cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
> </scr:component>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira