Open Stoneseraphic opened 9 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; }
按照楼上的方法,修改源代码后重新打包放进去后就可以解决了,感谢哈。