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不允许我。