YeautyYE / netty-websocket-spring-boot-starter

:rocket: lightweight high-performance WebSocket framework ( 轻量级、高性能的WebSocket框架)
Apache License 2.0
1.83k stars 541 forks source link

支持SpringBoot3.2吗 #265

Open Stoneseraphic opened 9 months ago

Stoneseraphic commented 9 months ago

image

MG-Thomas commented 6 months ago

同样的问题

jackM5 commented 6 months ago

我的解决方法: 1.在你的项目中resources增加META-INF.spring目录,新建org.springframework.boot.autoconfigure.AutoConfiguration.imports文件,加入org.yeauty.autoconfigure.NettyWebSocketAutoConfigure。 2.修改netty-websocket-spring-boot-starter源码,修改pojo下PojoMethodMapping类中getEndpointInstance方法如下: Object getEndpointInstance() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { Object implement = pojoClazz.getDeclaredConstructor().newInstance(); // AutowiredAnnotationBeanPostProcessor postProcessor = applicationContext.getBean(AutowiredAnnotationBeanPostProcessor.class); // postProcessor.postProcessPropertyValues(null, null, implement, null); AutowireCapableBeanFactory beanFactory = applicationContext.getAutowireCapableBeanFactory(); beanFactory.autowireBean(implement); return implement; }

ariallyp commented 3 months ago

按照楼上的方法,修改源代码后重新打包放进去后就可以解决了,感谢哈。