@Activate method not getting invoked

Avatar

Avatar

NaziyaP

Avatar

NaziyaP

NaziyaP

06-11-2020

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Anudeep_Garnepudi

Avatar

Anudeep_Garnepudi

Anudeep_Garnepudi

06-11-2020

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

Answers (3)

Answers (3)

Avatar

Avatar

ankurk67503819

Avatar

ankurk67503819

ankurk67503819

09-11-2020

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

Avatar

Avatar

sureshd71454102

Avatar

sureshd71454102

sureshd71454102

06-11-2020

Please check logs for any errors and paste the code here

Avatar

Avatar

Manjunath_K

Avatar

Manjunath_K

Manjunath_K

06-11-2020

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.