今天给我的毕业设计加上了AOP
日志拦截,结果导致了WebSocket
的报错。,错误信息为:
Failed to register @ServerEndpoint class: class pers.xuyijie.communityinteractionsystem.websocket.MyWebSocket$$EnhancerBySpringCGLIB Caused by: javax.websocket.DeploymentException: Cannot deploy POJO class[pers.xuyijie.communityinteractionsystem.websocket.MyWebSocket$$EnhancerBySpringCGLIB
原因是因为WebServerContainer
里面的addEndPoint
方法里的annotation
为 null。感谢 华阳余文乐https://blog.csdn.net/qq_15807785/article/details/83547978 ,上图是他的调试截图。
导致为 null 的原因是因为 aop 的@PointCut
注解和 Aop 自定义的@Log
注解,总之,aop 不能作用到 websocket 的文件,否则就会导致问题。
去掉 WebSocket 上的@Log
,并确保@PointCut 的 execution 中的包路径不包含
WebSocket 的文件就可以了。
启动成功
热门文章
- 穷人养什么宠物拉不拉(适合穷人养的10种狗)
- 3月9日→22.2M/S|2025年最新免费节点Clash for IOS订阅链接地址
- 4月7日→20.1M/S|2025年最新免费节点Clash for IOS订阅链接地址
- 动物疫苗的作用有哪些方面(动物接种疫苗的好处)
- 动物疫苗能放冰箱吗能放多久 动物疫苗能放冰箱吗能放多久啊
- 3月15日→19.5M/S|2025年最新免费节点Clash for IOS订阅链接地址
- 宠物粮食创业计划书怎么写(宠物粮行业环境分析)
- 3月11日→19.6M/S|2025年最新免费节点Clash for IOS订阅链接地址
- 3月3日→19.9M/S|2025年最新免费节点Clash for IOS订阅链接地址
- 3月22日→21.8M/S|2025年最新免费节点Clash for IOS订阅链接地址