AnsweredAssumed Answered

synchronization.import.cron problems

Question asked by marcobusetto on Jun 9, 2010
I would like to share the solution of an annoying issue about to the synchronization.import.cron setting.

I'm working in a test environment so I wanted to call the LDAP synchronization every 5 minutes but only in office hours, i.e. 9-18 from Monday to Friday:

synchronization.import.cron=0 0/5 9-18 * * MON-FRI
Unfortunately Alfresco doesn't like this setting and raises an exception during the startup:

ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'syncTrigger' defined in file [/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/subsystems/Synchronization/default/default-synchronization-context.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedOperationException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.
I did some search based on the message "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented" and I discovered that the character "*" in the day-of-month field is interpreted as a specific value and not as undefined. But since the presence of both "a day-of-week" and "a day-of-month" parameter is not implemented, the system raises the exception.

Luckily, if you don't need both parameters, the workaround is quite easy: Simply use the character "?" instead of "*" in the day-of-month field:

synchronization.import.cron=0 0/5 9-18 ? * MON-FRI
Hope this can help.
Bye.

Outcomes