Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

@Activate method not getting invoked

NaziyaP
Level 2
Level 2

Dear All,

We have one service class with one @activate method  which is not getting invoked, But is working fine in other class of the same app. Is there a constraint that only one @activate can be used in one app-core?

 

Thanks in advance

Activate AEM annotations
1 Accepted Solution
Anudeep_Garnepudi
Correct answer by
Community Advisor
Community Advisor

Hi @NaziyaP 

Method with @Activate annotation will only be called once your Component(or Service) is activated. If Component has any dependencies it won't be activated hence your activate method won't be executed. Check if your Component/Service has any dependencies and try to resolve.

AG

View solution in original post

6 Replies
Manjunath_K
Community Advisor
Community Advisor

Hi @NaziyaP,

There is no constraints as such, can you please add code snippet/screenshot of class where this activate method is not getting invoked.

SureshDhulipudi
Community Advisor
Community Advisor

Please check logs for any errors and paste the code here

NaziyaP
Level 2
Level 2
There is no error and it is a simple @activate method, cant paste code .
Anudeep_Garnepudi
Correct answer by
Community Advisor
Community Advisor

Hi @NaziyaP 

Method with @Activate annotation will only be called once your Component(or Service) is activated. If Component has any dependencies it won't be activated hence your activate method won't be executed. Check if your Component/Service has any dependencies and try to resolve.

AG

View solution in original post

ankurk67503819
Level 4
Level 4

There is no such constraint

Could you please go to systsem console and inder components tab go to your service and see if it is axtive or not not some refrences are in satisfied state.

If its not active it will not work, try to resolve dependencies.

Hope this helps

kautuk_sahni
Community Manager
Community Manager
Wonderful reply, thanks for sharing the knowledge.