title: java.lang.NoClassDefFoundError: org/springframework/security/authentication/AuthenticationManager
body: <p>I am trying to implement authentication on Spring web service by referring the following link:</p>
  
  <p><a href="http://docs.spring.io/spring-ws/site/reference/html/security.html" rel="noreferrer">http://docs.spring.io/spring-ws/site/reference/html/security.html</a></p>
  
  <p>Following is the configuration I have added:</p>
  
  <pre><code>    &lt;bean
          class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"&gt;
          &lt;property name="interceptors"&gt;
              &lt;list&gt;
                  &lt;ref local="wsServerSecurityInterceptor" /&gt;
                  &lt;ref local="payloadValidatingIterceptor" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;bean id="wsServerSecurityInterceptor"
          class="org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor"&gt;
          &lt;property name="policyConfiguration"
              value="classpath:security/xwss/security-server-policy.xml" /&gt;
          &lt;property name="callbackHandlers"&gt;
              &lt;list&gt;
                  &lt;!-- &lt;ref bean="keyStoreHandlerServer" /&gt; --&gt;
                  &lt;ref bean="springSecurityHandler" /&gt;
                  &lt;ref bean="callbackHandlerServer" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;bean id="springSecurityHandler"
        class="org.springframework.ws.soap.security.xwss.callback.SpringPlainTextPasswordValidationCallbackHandler"&gt;
      &lt;property name="authenticationManager" ref="authenticationManager"/&gt;
    &lt;/bean&gt;
    &lt;bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager"&gt;
        &lt;property name="providers"&gt;  
        &lt;list&gt;
      &lt;ref local="authenticationProvider" /&gt;
      &lt;/list&gt;        
      &lt;/property&gt;
    &lt;/bean&gt;
    &lt;bean id="authenticationProvider"
     class="org.springframework.security.providers.dao.DaoAuthenticationProvider"&gt;
                &lt;property name="userDetailsService" ref="userDetailsService"/&gt;
            &lt;/bean&gt;  
     &lt;bean id="userDetailsService" class="com.impl.endpoints.calc.client.JpaUserDetailsService" /&gt; 
  </code></pre>
  
  <p>While deploying the war file on server, I get following error:</p>
  
  <pre><code>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.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping#0' defined in ServletContext resource [/WEB-INF/xws-spring-ws-servlet.xml]: Cannot resolve reference to bean 'wsServerSecurityInterceptor' while setting bean property 'interceptors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wsServerSecurityInterceptor' defined in ServletContext resource [/WEB-INF/xws-spring-ws-servlet.xml]: Cannot resolve reference to bean 'springSecurityHandler' while setting bean property 'callbackHandlers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityHandler' defined in ServletContext resource [/WEB-INF/xws-spring-ws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/authentication/AuthenticationManager
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
  </code></pre>
  
  <p>org/springframework/security/authentication/AuthenticationManager is not mentioned anywhere in the configuration or the code. I wonder where exactly the given class is required and what configuration change I need to do to resolve this error.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>POM contains following spring security jars:</p>
  
  <pre><code>        &lt;dependency&gt;
          &lt;groupId&gt;
                  org.springframework.security
                  &lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
          &lt;version&gt;2.0.4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;
                  org.springframework.security
                  &lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-taglibs&lt;/artifactId&gt;
          &lt;version&gt;3.1.7.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-ldap&lt;/artifactId&gt;
          &lt;version&gt;3.1.7.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.ws&lt;/groupId&gt;
          &lt;artifactId&gt;spring-ws-security&lt;/artifactId&gt;
          &lt;version&gt;2.2.0.RELEASE&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.sun.xml.wsit&lt;/groupId&gt;
                  &lt;artifactId&gt;xws-security&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.sun.xml.wsit&lt;/groupId&gt;
                  &lt;artifactId&gt;wsit-rt&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  </code></pre>