title: SubProtocolWebSocketHandler - No handlers
body: <p>I have this ugly error during deploying Spring app on JBoss. </p>
  
  <pre><code>18:11:16,025 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/consumer]] (MSC service thread 1-7) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.context.ApplicationContextException: Failed to start bean 'subProtocolWebSocketHandler'; nested exception is java.lang.IllegalArgumentException: No handlers
      at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:176) [spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51) [spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346) [spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149) [spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112) [spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:770) [spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483) [spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) [spring-web-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_76]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_76]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_76]
  Caused by: java.lang.IllegalArgumentException: No handlers
      at org.springframework.util.Assert.isTrue(Assert.java:65) [spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.start(SubProtocolWebSocketHandler.java:234) [spring-websocket-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173) [spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      ... 17 more
  </code></pre>
  
  <p>This error occurred during init SubProtocolWebSocketHandler. I also paste below my MessageBroker implementation.</p>
  
  <pre><code>@Configuration
  @EnableWebSocketMessageBroker
  @Component("messageBroker")
  public class MessageBroker implements WebSocketMessageBrokerConfigurer {
  
      @Override
      public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
          stompEndpointRegistry.addEndpoint("/random").withSockJS();
      }
  
      @Override
      public void configureMessageBroker(MessageBrokerRegistry messageBrokerRegistry) {
          messageBrokerRegistry.setApplicationDestinationPrefixes("/app").enableSimpleBroker("/queue", "/topic");
      }
  
      @Override
      public void configureWebSocketTransport(WebSocketTransportRegistration webSocketTransportRegistration) {
      }
  
      @Override
      public void configureClientInboundChannel(ChannelRegistration channelRegistration) {
      }
  
      @Override
      public void configureClientOutboundChannel(ChannelRegistration channelRegistration) {
      }
  
      @Override
      public void addArgumentResolvers(List&lt;HandlerMethodArgumentResolver&gt; handlerMethodArgumentResolvers) {
  
      }
  
      @Override
      public void addReturnValueHandlers(List&lt;HandlerMethodReturnValueHandler&gt; handlerMethodReturnValueHandlers) {
  
      }
  
      @Override
      public boolean configureMessageConverters(List&lt;MessageConverter&gt; messageConverters) {
          messageConverters.add(new MappingJackson2MessageConverter());
          return true;
      }
  }
  </code></pre>
  
  <p>I must to add that I am using Spring 4.1.3.RELEASE and Spring Messaging 4.1.3.RELEASE. Thanks for help!</p>