5.7K Star 40.9K Fork 22.2K

GVP若依 / RuoYi

 / 详情

controller异步返回DeferredResult出现shiro异常错误

已完成
创建于  
2018-09-27 17:44

@GetMapping("/async")
@ResponseBody
public DeferredResult async() {
Long timeout = 1000 * 10L;
DeferredResult deferredResult = new DeferredResult<>
(timeout, error("请求超时"));
new Thread(() -> {
try {
Thread.sleep(1000 * 15);
} catch (InterruptedException e) {
e.printStackTrace();
}
deferredResult.setResult(success("异步操作完成"));
}).start();
return deferredResult;
}

出错信息:
org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton.

评论 (1)

linjiegege 创建了任务
若依 任务状态待办的 修改为已完成
展开全部操作日志

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
339904 linjiegege 1578920581
Java
1
https://gitee.com/y_project/RuoYi.git
git@gitee.com:y_project/RuoYi.git
y_project
RuoYi
RuoYi

搜索帮助