title: Spring Security LDAP IncorrectResultSizeDataAccessException
body: <p>I have racked my brain about this for a while now, and have gotten nowhere.  This is what is in my security-context.xml.  This is going to be a servlet.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;security:http auto-config="true"&gt;
      &lt;security:intercept-url pattern="/"
          access="IS_AUTHENTICATED_REMEMBERED" /&gt;
      &lt;security:intercept-url pattern="/login.html"
          access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
      &lt;security:form-login login-page="/login.html"
          authentication-failure-url="/loginFailed.html" default-target-url="" /&gt;
      &lt;security:anonymous /&gt;
      &lt;security:logout /&gt;
  &lt;/security:http&gt;
  
  &lt;security:authentication-manager alias="authenticationManager"&gt;
      &lt;security:authentication-provider
          ref="ldapAuthProvider" /&gt;
  &lt;/security:authentication-manager&gt;
  
  &lt;beans:bean id="ldapAuthProvider"
      class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider"&gt;
      &lt;beans:constructor-arg&gt;
          &lt;beans:bean
              class="org.springframework.security.ldap.authentication.BindAuthenticator"&gt;
              &lt;beans:constructor-arg ref="contextSource" /&gt;
              &lt;beans:property name="userSearch" ref="userSearch"&gt;
              &lt;/beans:property&gt;
          &lt;/beans:bean&gt;
      &lt;/beans:constructor-arg&gt;
      &lt;beans:constructor-arg&gt;
          &lt;beans:bean id="authoritiesPopulator"
              class="org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator"&gt;
              &lt;beans:constructor-arg ref="contextSource" /&gt;
              &lt;beans:constructor-arg value="" /&gt;
              &lt;beans:property name="groupRoleAttribute" value="cn" /&gt;
              &lt;beans:property name="searchSubtree" value="true" /&gt;
              &lt;beans:property name="rolePrefix" value="ROLE_" /&gt;
              &lt;beans:property name="convertToUpperCase" value="true" /&gt;
          &lt;/beans:bean&gt;
      &lt;/beans:constructor-arg&gt;
  &lt;/beans:bean&gt;
  
  &lt;beans:bean id="contextSource"
      class="org.springframework.security.ldap.DefaultSpringSecurityContextSource"&gt;
      &lt;beans:constructor-arg
          value="thepathtomyLDAPdatabase" /&gt;
      &lt;beans:property name="userDn"
          value="theuserpathforLDAP" /&gt;
      &lt;beans:property name="password" value="mypassword" /&gt;
  &lt;/beans:bean&gt;
  
  &lt;beans:bean id="userSearch"
      class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch"&gt;
      &lt;beans:constructor-arg index="0" value="CN=Users" /&gt;
      &lt;beans:constructor-arg index="1"
          value="(sAMAccountName={0})" /&gt;
      &lt;beans:constructor-arg index="2" ref="contextSource" /&gt;
      &lt;beans:property name="searchSubtree" value="true" /&gt;
  &lt;/beans:bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>I keep getting the following error:</p>
  
  
  
  <pre><code>nested exception is java.lang.NoClassDefFoundError: org/springframework/dao/IncorrectResultSizeDataAccessException
  </code></pre>
  
  <p>Can someone please tell me what I am doing wrong?  Thanks.</p>