title: Error while configuring concurrency in Spring Security 3.05
body: <p>I get the following error while configuring concurrency in Spring Security 3.05.  I am using Tomcat 7.  I have followed the Spring Security documentation and cannot understand why I get this error.</p>
  
  <pre><code>SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Cannot resolve reference to bean 'concurrencyFilter' while setting bean property 'filterChainMap' with key [/**] with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'concurrencyFilter' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.security.core.session.SessionRegistry' for property 'sessionRegistry'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.security.core.session.SessionRegistry] for property 'sessionRegistry': no matching editors or conversion strategy found
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:378)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:161)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'concurrencyFilter' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.security.core.session.SessionRegistry' for property 'sessionRegistry'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.security.core.session.SessionRegistry] for property 'sessionRegistry': no matching editors or conversion strategy found
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
      ... 27 more
  Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.security.core.session.SessionRegistry' for property 'sessionRegistry'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.security.core.session.SessionRegistry] for property 'sessionRegistry': no matching editors or conversion strategy found
      at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:481)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:518)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      ... 33 more
  Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.security.core.session.SessionRegistry] for property 'sessionRegistry': no matching editors or conversion strategy found
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:233)
      at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:466)
      ... 39 more
  </code></pre>
  
  <p>Here is my spring security configuration file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
             http://www.springframework.org/schema/security
             http://www.springframework.org/schema/security/spring-security-3.0.xsd"&gt;
  
      &lt;http auto-config="false" use-expressions="true"
          access-denied-page="/jsp/accessDenied.jsp" 
          entry-point-ref="authenticationEntryPoint"&gt;
          &lt;intercept-url pattern="/login.jsp" filters="none" /&gt;
              &lt;intercept-url pattern="/**" access="hasRole('ROLE_USER')" /&gt;
          &lt;logout invalidate-session="true" logout-url="/logout.htm"
                  logout-success-url="/login.jsp?loggedout=true"/&gt;
              &lt;custom-filter ref="authenticationFilter" 
                  position="FORM_LOGIN_FILTER"/&gt;
              &lt;custom-filter ref="concurrencyFilter" 
                  position="CONCURRENT_SESSION_FILTER"/&gt;
    &lt;!--          &lt;security:custom-filter ref="singleEntryFilter"
                  after="CONCURRENT_SESSION_FILTER"/&gt; --&gt; 
              &lt;session-management session-authentication-strategy-ref="sas"/&gt; 
      &lt;/http&gt;
   &lt;!--   &lt;bean id="singleEntryFilter" 
          class="SingleEntryFilter"
          p:redirectURI="/login.jsp"&gt;
              &lt;property name="guardURI"&gt;
                  &lt;list&gt;
                      &lt;value&gt;/jsp&lt;/value&gt;
                  &lt;/list&gt;    
              &lt;/property&gt;  
      &lt;/bean&gt; --&gt;
      &lt;beans:bean id="authenticationFilter" 
          class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"&gt;
             &lt;beans:property name="sessionAuthenticationStrategy-ref" value="sas"/&gt;
              &lt;beans:property name="authenticationManager-ref" value="authenticationManager"/&gt;
              &lt;beans:property name="authenticationFailureHandler-ref" value="customAuthenticationFailureHandler"/&gt;
              &lt;beans:property name="authenticationSuccessHandler-ref" value="customAuthenticationSuccessHandler"/&gt; 
      &lt;/beans:bean&gt;
      &lt;beans:bean id="customAuthenticationFailureHandler"
          class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler"&gt;
          &lt;beans:property name="defaultFailureUrl" value="/login.jsp?authfailed=true"/&gt;
      &lt;/beans:bean&gt;    
      &lt;beans:bean id="customAuthenticationSuccessHandler"
          class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler"&gt;
              &lt;beans:property name="defaultTargetUrl" value="/index.jsp" /&gt;
      &lt;/beans:bean&gt;
      &lt;beans:bean id="authenticationEntryPoint"  
          class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"&gt;   
          &lt;beans:property name="loginFormUrl" value="/login.jsp"/&gt; 
      &lt;/beans:bean&gt;
  
      &lt;authentication-manager alias="authenticationManager"&gt;
      &lt;authentication-provider user-service-ref="userDetailsService"&gt;
              &lt;password-encoder ref="passwordEncoder"/&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
      &lt;beans:bean class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"
              id="passwordEncoder"/&gt;
      &lt;user-service id="userDetailsService"&gt;
              &lt;user name="username" password="ee11cbb19052e40b07aac0ca060c23ee"
                  authorities="ROLE_USER, ROLE_ADMIN" /&gt;
              &lt;user name="test" password="21232f297a57a5a743894a0e4a801fc3"
                  authorities="ROLE_USER" /&gt;
      &lt;/user-service&gt;
      &lt;beans:bean id="concurrencyFilter" 
          class="org.springframework.security.web.session.ConcurrentSessionFilter"&gt;
          &lt;beans:property name="sessionRegistry" value="sessionRegistry"/&gt;    
          &lt;beans:property name="expiredUrl" value="/login.jsp?loggedout=true" /&gt;
      &lt;/beans:bean&gt;
      &lt;beans:bean id="sas" 
          class="org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy"&gt;
          &lt;beans:property name="maximumSessions" value="1" /&gt;    
          &lt;beans:constructor-arg name="sessionRegistry" ref="sessionRegistry" /&gt;
      &lt;/beans:bean&gt;
      &lt;beans:bean id="sessionRegistry" 
          class="org.springframework.security.core.session.SessionRegistryImpl" /&gt; 
  &lt;/beans:beans&gt;
  </code></pre>