The circled one is my scheduler.
But below when i see, i only see the default scheduler.
Any Help would be Highly appreciated.
Currently I'm using AEM 6.5.13.
Solved! Go to Solution.
Views
Replies
Total Likes
You have to use ResourceResolverFactory to get ResourceResolver object. It is not possible to get ResourceResolver object via @reference in OSGi component/service
@ Reference
private ResourceResolverFactory resourceResolverFactory
Please also confirm if above finding was the root cause, as I pointed out.
Could you please check the cron expression, if you have wrong expression you cannot see that in scheduler console
Also check if all the Reference services are up and running
Refer this sample example for end to end scheduler code
https://aem.redquark.org/2018/10/day-13-schedulers-in-aem.html?m=1
Can you please provide your scheduler source code
Sure, I'm providing the screenshot of my sample code.
Here is my configuration class:
Please check your scheduler with
1. cron expression is correct or not or add default one for testing
2. please status in Felix console active or not.
3. Check dependent services are active or satisfied state.
4. Put some logs to validate initialization.
1. cron expression is correct or not or add default one for testing : Checked this, this one is correct, I'm Using cron expression from cronmakker.in
2. please status in Felix console active or not. : My Bundle is in active state
3. Check dependent services are active or satisfied state.: Everything looks fine over here.
4. Put some logs to validate initialization. : Check still, not able to get any thing in log.
@lukasz-m @arunpatidar Can you please help me, I have attached the screenshot of my sample code in Below comments.
Your cron expression looks fine
Could you please try with https://github.com/arunpatidar02/aemaacs-aemlab/blob/master/core/src/main/java/com/community/aemlab/...
Tried this as well, but it did'nt worked
The thing is when i place my logic of void run, under void run() of your of code which you have provided. The scheduler disappear in Sling scheduler console.
Can you share your code as text here, so I can try in local?
Hi @avi_infy,
The problem is that line:
@Reference
private Resource resource;
Your OSGi component most likely did not start is not satisfied, because it was not possible to get above reference. You can confirm component status under /system/console/components.
Unfortunately you can not get resource in above way. You will need ResourceResolver and path to resource. You can get ResourceResolver via ResourceResolverFactory.
Please remove above line from you code - this will allow you to confirm that this is a root cause.
Can I use
@ Reference
private ResourceResolver resourceResolver; directly, or i have to only get it through ResourceResolverFactory?
You have to use ResourceResolverFactory to get ResourceResolver object. It is not possible to get ResourceResolver object via @reference in OSGi component/service
@ Reference
private ResourceResolverFactory resourceResolverFactory
Please also confirm if above finding was the root cause, as I pointed out.
Views
Likes
Replies