title: Hazelcast not working with Spring security (no SessionRegistry bean found)
body: <p>I'am using Hazelcast 3.4 with Spring security 3.2.5. When I deploy the application and try to log in, the login is successful but an exception is thrown, resulting in an error page. Regardless of the error page I am logged in and my session is "alive". But after each login I always get the execption and as a result a land on the error page (which I have set up to appear in case of an unhandled exception).</p>
  
  <p>My Hazelcast config in the web.xml:</p>
  
  <pre><code>     &lt;filter&gt;
      &lt;filter-name&gt;hazelcast-filter&lt;/filter-name&gt;
      &lt;filter-class&gt;com.hazelcast.web.spring.SpringAwareWebFilter&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;map-name&lt;/param-name&gt;
          &lt;param-value&gt;at-sessions&lt;/param-value&gt;
      &lt;/init-param&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;sticky-session&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cookie-name&lt;/param-name&gt;
          &lt;param-value&gt;hsessionId&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cookie-http-only&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;instance-name&lt;/param-name&gt;
          &lt;param-value&gt;hazelcastInstance&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;shutdown-on-destroy&lt;/param-name&gt;
          &lt;param-value&gt;false&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;com.hazelcast.web.SessionListener&lt;/listener-class&gt;
  &lt;/listener&gt; 
  
  
   &lt;filter-mapping&gt;
      &lt;filter-name&gt;hazelcast-filter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
      &lt;dispatcher&gt;INCLUDE&lt;/dispatcher&gt;
      &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>My hazelcast config in the Spring context xml:</p>
  
  <pre><code>&lt;hz:hazelcast id="hazelcastInstance"&gt;
      &lt;hz:config&gt;
          &lt;hz:instance-name&gt;hazelcastInstance&lt;/hz:instance-name&gt;
          &lt;hz:group name="${hazelcast.group.name}" password="${hazelcast.group.password}"/&gt;
          &lt;hz:properties&gt;
              &lt;hz:property name="hazelcast.jmx"&gt;true&lt;/hz:property&gt;
              &lt;hz:property name="hazelcast.logging.type"&gt;slf4j&lt;/hz:property&gt;
          &lt;/hz:properties&gt;
          &lt;hz:network port="${hazelcast.port}"&gt;
              &lt;hz:join&gt;
                  &lt;hz:multicast enabled="false"/&gt;
                  &lt;hz:tcp-ip enabled="${hazelcast.tcp.ip.enabled}"&gt;
                      &lt;hz:members&gt;${hazelcast.tcp.ip.members}&lt;/hz:members&gt;
                  &lt;/hz:tcp-ip&gt;
                  &lt;hz:aws enabled="${hazelcast.aws.enabled}"
                      access-key="${hazelcast.aws.access.key}"
                      secret-key="${hazelcast.aws.secret.key}"
                      region="${hazelcast.aws.region}"
                      tag-key="${hazelcast.aws.tag.key}"
                      tag-value="${hazelcast.aws.tag.value}"
                  /&gt;
              &lt;/hz:join&gt;
          &lt;/hz:network&gt;
          &lt;hz:map name="at-sessions"
              in-memory-format="${hazelcast.sessions.in.memory.format}"
              backup-count="${hazelcast.sessions.backup.count}"
              async-backup-count="${hazelcast.sessions.async.backup.count}"
              time-to-live-seconds="${hazelcast.sessions.ttl.seconds}"
              max-idle-seconds="${hazelcast.sessions.max.idle.seconds}"
              eviction-policy="LRU"
              max-size-policy="USED_HEAP_PERCENTAGE"
              max-size="${hazelcast.sessions.max.size}"
              eviction-percentage="${hazelcast.sessions.eviction.percentage}"
              merge-policy="${hazelcast.sessions.merge.policy}"
          /&gt;
      &lt;/hz:config&gt;
  
  &lt;/hz:hazelcast&gt;
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <pre><code>Caused by: javax.servlet.ServletException: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.security.core.session.SessionRegistry] is defined
      at org.apache.jsp.WEB_002dINF.views.common.general_002derror_jsp._jspService(general_002derror_jsp.java:195) ~[na:na]
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[jasper.jar:7.0.57]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [servlet-api.jar:na]
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) ~[jasper.jar:7.0.57]
      ... 97 common frames omitted
  </code></pre>
  
  <p>Without Hazelcast the login is working completely fine. Any help would be greatly appreciated.</p>