@sharable handler,so can't be added or removed multiple times

@sharable handler,so can't be added or removed multiple times

1.场景

            netty集成springboot出现如上报错,像网上的事例,大部分都是没有继承springboot,例如下面代码

集成springboot的代码:

因是通过注入的方式,而不是通过new

解决方案:

增加@Sharable注解

 

     

发布了261 篇原创文章 · 获赞 344 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/qq_16855077/article/details/103492712