6
我的Java代碼:
@Scheduled(cron = "${invoice.export.cron}")
private void scheduledExport() {
// ... the code to execute ...
}
,並在我的屬性文件,我有invoice.export.cron: 0 0 7 * * MON-FRI?
,使調度我在我的主要配置類有@EnableScheduling
。
我試圖調試到這個問題,並發現cron表達式應該從財產佔位here解決。以下呼叫到resolveStringValue
使我this位置爲AbstractBeanFactory
。就我所知,這是問題所在。該this.embeddedValueResolvers
列表爲空...因此它不能解決我傳遞給@Scheduled(cron)
財產。
任何人有一個想法,如果我做錯了什麼或在這裏錯過了什麼?
在此先感謝! :)
謝謝@Ruben這個工程。 :) – Dodge