cancel
Showing results for 
Search instead for 
Did you mean: 

delaying schedulerFactory startup until bootstrap is complet

skoalbrother952
Champ in-the-making
Champ in-the-making
We occasionally wipe the store/db when deploying to our QA environment, creating a 'clean' application.

We have a number of quartz jobs that we've configured in a manner as seen in scheduled-jobs-context.xml. 


<bean id="manualPdfUploadTrigger" class="org.alfresco.util.CronTriggerBean" lazy-init="default" autowire="default" dependency-check="default">
  <property name="jobDetail" ref="manualPdfUploadJobDetail" />
- <!–  Once every 30 seconds, continuously
  –>
  <property name="cronExpression" value="0/30 * * * * ?" />
  <property name="scheduler" ref="schedulerFactory" />
  </bean>

The job is trapping a NPE when accessing repository.getCompanyHome().  We are suspecting that the companyHome node is not created yet.

We were hoping that if the repo is being created/refreshed that the scheduler startup would be delayed until after the refresh was completed.  It appears that is not the case.

Maybe we are missing something in our configuration ? 
Is the scheduler startup delayed untl after the bootstrap?

Thanks

ALF enterprise 3.4.2
2 REPLIES 2

tusharpatel88
Champ in-the-making
Champ in-the-making
Hello

I want to start my cron job om start up of server. How can I achieve that?

THANKS

kaynezhang
World-Class Innovator
World-Class Innovator
you can try to add depends-on attribute in your bean defination to make it depends on repositoryEndBootstrapBean,like following

<bean id="manualPdfUploadTrigger" class="org.alfresco.util.CronTriggerBean" depends-on="repositoryEndBootstrapBean" lazy-init="default" autowire="default" dependency-check="default">