There is no session with id [xxx]

新手上路,请多包涵

框架采用的是 SpringBoot+MybatisPlus+Shiro
我利用org.springframework.scheduling 创建定时任务:

    /**
     * 定时扫描WMS回传的数据,整理成报关数据
     */
    @Scheduled(fixedDelay = 1000*60*10)//每10分钟执行一次。
    public void reductionClearance(){
        DefaultSecurityManager manager = new DefaultSecurityManager();
        ThreadContext.bind(manager);

        log.info("整理报关数据:");
        ladingClearanceService.reductionClearance();
    }

ladingClearanceService.reductionClearance();方法是操作数据库的。
这个定时任务每次执行都报错: There is no session with id [de1c4c42-498e-4a10-900b-63f95421a4f3] ,哪位遇到过这个问题啊?求指教。

阅读 1.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题