Spring-websocket 和 SSM+shiro 整合时 No SecurityManager accessible to the calling

DoitPlayer 2017-09-05 10:06:11
Spring-websocket 和 SSM+shiro 整合时
在WebSocketHandler 里的afterConnectionEstablished 方法里调用 Subject subject = SecurityUtils.getSubject();
报异常:
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. This is an invalid application configuration.

网上目前说的添加过滤器的方法都实验过了,不好用。
我的感觉WebSocketHandler 但是单独启动的一个线程,这个线程没有在SecurityManager 里的范围里。其他Controller和service 都没有问题。

求助!!!
...全文
509 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
涟漪海洋 2018-10-11
  • 打赏
  • 举报
回复
你的问题解决了么,在websocket中想获取shiro中的用户信息,应该如何获取呢

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧