AnsweredAssumed Answered

Alfresco Trashcan Cleaner - error during execution by cron

Question asked by tomekszy on Nov 3, 2016
Latest reply on Dec 1, 2016 by cesarista

I have installed alfresco-trashcan-cleaner AMP, and of course I have a problem with that

I got in my log:

2016-11-03 04:00:00,388 ERROR [org.quartz.core.JobRunShell] [DefaultScheduler_Worker-6] Job DEFAULT.tempFileCleanerJobDetail#1 threw an unhandled Exception:
java.lang.NullPointerException
at org.alfresco.trashcan.TrashcanCleaner.olderThanDaysToKeep(TrashcanCleaner.java:102)
at org.alfresco.trashcan.TrashcanCleaner.fillBatchToDelete(TrashcanCleaner.java:84)
at org.alfresco.trashcan.TrashcanCleaner.getBatchToDelete(TrashcanCleaner.java:75)
at org.alfresco.trashcan.TrashcanCleaner.clean(TrashcanCleaner.java:48)
at org.alfresco.trashcan.TrashcanCleanerJob$1.execute(TrashcanCleanerJob.java:36)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
at org.alfresco.trashcan.TrashcanCleanerJob.cleanInTransaction(TrashcanCleanerJob.java:40)
at org.alfresco.trashcan.TrashcanCleanerJob.executeJob(TrashcanCleanerJob.java:29)
at org.alfresco.schedule.ScheduledJobLockExecuter.execute(ScheduledJobLockExecuter.java:93)
at org.alfresco.schedule.AbstractScheduledLockedJob.executeInternal(AbstractScheduledLockedJob.java:71)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:114)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2016-11-03 04:00:00,391 ERROR [org.quartz.core.ErrorLogger] [DefaultScheduler_Worker-6] Job (DEFAULT.tempFileCleanerJobDetail#1 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
Caused by: java.lang.NullPointerException
at org.alfresco.trashcan.TrashcanCleaner.olderThanDaysToKeep(TrashcanCleaner.java:102)
at org.alfresco.trashcan.TrashcanCleaner.fillBatchToDelete(TrashcanCleaner.java:84)
at org.alfresco.trashcan.TrashcanCleaner.getBatchToDelete(TrashcanCleaner.java:75)
at org.alfresco.trashcan.TrashcanCleaner.clean(TrashcanCleaner.java:48)
at org.alfresco.trashcan.TrashcanCleanerJob$1.execute(TrashcanCleanerJob.java:36)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
at org.alfresco.trashcan.TrashcanCleanerJob.cleanInTransaction(TrashcanCleanerJob.java:40)
at org.alfresco.trashcan.TrashcanCleanerJob.executeJob(TrashcanCleanerJob.java:29)
at org.alfresco.schedule.ScheduledJobLockExecuter.execute(ScheduledJobLockExecuter.java:93)
at org.alfresco.schedule.AbstractScheduledLockedJob.executeInternal(AbstractScheduledLockedJob.java:71)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:114)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
... 1 more

My settings from alfresco-global.properties are:

system.content.eagerOrphanCleanup=true
trashcan.cron=0 0 4 * * ?
trashcan.daysToKeep=1
trashcan.deleteBatchCount=1000
log4j.logger.org.alfresco.trashcan=debug
trashcan.cleaner.cron=0 0 4 * * ?
trashcan.cleaner.protected.day=1

I think it could be related with bad settings in alfresco-global.properties, but I don't know which are proper. I tried to change the storeUrl parameter in services-context.xml file, but I couldn't find store Url parameter.
My Alfresco version is Community-5.1.0, and i use trashcan AMP version 1.2

Outcomes