1
獲得安全上下文我得到的錯誤無法從計劃任務
org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task.
java.lang.SecurityException: No security context bound to the current thread
使用核心模塊在計劃任務在應用程序啓動一次執行任務:
<task:scheduled-tasks scheduler="scheduler">
<task:scheduled ref="app_OlapService" method="initialize" fixed-rate="9223372036854775807"/>
</task:scheduled-tasks>
我已經在注入的Authentication實例上嘗試了@Authenticated註解和authentication.begin()。
它看起來像一個單獨的調度觸發的錯誤,我也有一個空方法體相同的錯誤。
我也開放了替代方法,考慮到我需要使用事務和@PostConstruct AppContext.Listener不允許我。