狼王_ 2021-09-26 11:06 采纳率: 0%
浏览 45

定时任务报错:There is no session with id [de1c4c42-498e-4a10-900b-63f95421a4f3]

框架采用的是 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] ,哪位遇到过这个问题啊?求指教。

  • 写回答

2条回答 默认 最新

  • 编号灬9527 2021-09-26 11:07
    关注

    自己debug呗

    评论

报告相同问题?

问题事件

  • 创建了问题 9月26日