我的项目是用了 SpringBoot + shiro,然后在系统中创建定时任务时报错
定时任务:
@Slf4j
@Component
@EnableScheduling // 1.开启定时任务
@EnableAsync // 2.开启多线程
public class ScheduleTask {
@Scheduled(fixedDelay = 1000*10)
//@Scheduled(fixedDelay = 1000*60)
public void reductionClearance(){
DefaultWebSecurityManager manager = new DefaultWebSecurityManager();
ThreadContext.bind(manager);
log.info("整理报关数据:");
//调用Service层方法操作数据库
ladingClearanceService.reductionClearance();
}
报错信息:
SessionContext must be an HTTP compatible implementation.