[ https://issues.apache.org/jira/browse/KARAF-3142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14076892#comment-14076892
]
Scott Hull commented on KARAF-3142:
-----------------------------------
This seems to be related to an issue with SCR and Felix.
http://stackoverflow.com/questions/22813438/jcr-eventlistener-activate-method-not-found-adobe-cq-5-6-0
(Scroll down to bottom)
I will close this issue
> Karaf 2.3.5 not picking up @Activate for arguments ComponentContext
> -------------------------------------------------------------------
>
> Key: KARAF-3142
> URL: https://issues.apache.org/jira/browse/KARAF-3142
> Project: Karaf
> Issue Type: Bug
> Reporter: Scott Hull
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> I am unable to get the @Activate command to work for a Declarative Service with anything
other than a nullary operation.
> @Annotations are from Felix SCR
> For example:
> @Component(name="FakeyService", enabled=true)
> public class FakeService {
> @Activate
> protected void activate(ComponentContext context){
> System.out.println("Fake Service activated!");
> }
> public FakeService() {
> System.out.println("FakeService created!");
> }
>
> }
> In the console (with install -s) I get the following message:
> karaf@root>FakeService created!
> When I install this into my karaf container, I get the following error in the log:
> inputsourcehandler - 1.0.0 | [FakeyService(7)] activate method [activate] not found;
Component will fail
> inputsourcehandler - 1.0.0 | [FakeyService(7)] Failed creating the component instance;
see log for reason
> Here is the generated XML file from the annotations:
> <?xml version="1.0" encoding="UTF-8"?>
> -<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
> -<scr:component modified="modified" deactivate="deactivate" activate="activate" name="FakeyService"
enabled="true">
> <implementation class="com.modusoperandi.inputsourcehandler.service.FakeService"/>
> <property name="service.pid" value="FakeyService"/>
> </scr:component>
> </components>
> Pom project states using
> <dependency>
> <groupId>org.apache.felix</groupId>
> <artifactId>org.apache.felix.scr.annotations</artifactId>
> <version>1.9.6</version>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.apache.felix</groupId>
> <artifactId>org.apache.felix.scr</artifactId>
> <version>1.8.2</version>
> <scope>provided</scope>
> </dependency>
> And using the build plugin 1.17 scr annotations.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
|