title: SimpMessagingTemplate no qualifying bean of type
body: <p>I'm trying to use the <code>SimpMessagingTemplate</code> class in my project to send some data via websocket.
  The problem is that I always have an error, here is the complete error:</p>
  <pre><code>Error creating bean with name 'webSocketUserNotificationManagerImpl' defined in URL [...]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.messaging.simp.SimpMessagingTemplate' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
  </code></pre>
  <p>And here is the <code>webSocketuserNotificationManagerImpl</code> service:</p>
  <pre><code>@Service
  public class WebSocketUserNotificationManagerImpl implements UserNotificationManager {
  
      /**
       * Template to use to send back a message to the user via Web-socket.
       */
      private SimpMessagingTemplate template;
  
      public WebSocketUserNotificationManagerImpl(SimpMessagingTemplate template) {
          this.template = template;
      }
  
      private ObjectMapper jsonMapper = new ObjectMapper();
  
      @Override
      public void sendMessageToUser(String jobName, String eventType, Result result) {
         ....
      }
  
      public void sendDeleteMessageToUser(DeleteRequestsSocketMessage message, Principal principal) {
          this.template.convertAndSendToUser(principal.getName().toLowerCase(),
                                             &quot;/status/delete&quot;, message);
      }
  }
  </code></pre>
  <p>I have this dependency in my pom:</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
      &lt;artifactId&gt;spring-security-messaging&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>What is wrong, why the <code>SimpMessagingTemplate</code> bean doesn't exist ?</p>