Could not autowire. No beans of SimpMessagingTemplate type found

后端 未结 4 939
自闭症患者
自闭症患者 2020-12-31 03:09

I am configuring Websockets in Spring basically by following the guide provided in the documentation.

I am currently trying to send a message from the server to the

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-31 03:25

    I had the same problem, the error occurred because my websocket config file:

    @Configuration
    @EnableWebSocketMessageBroker
    @EnableScheduling
    public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
    
    }
    

    was not scanned by spring.

    so the fix was to add the package with this configuration file to the scanned packages.

提交回复
热议问题