title: ClassNotFoundException: org.springframework.security.core.SpringSecurityCoreVersion
body: <p>I have developed a spring web application and I implement Spring security in it. Here is the error which I have got.</p>
  
  <pre><code>ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
  org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/appServlet/spring-security.xml]; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.security.config.SecurityNamespaceHandler]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
      at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
      at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
      at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
      at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.security.config.SecurityNamespaceHandler]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:105)
      at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:129)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1433)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:185)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
      ... 22 more
  Caused by: java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion
      at org.springframework.security.config.SecurityNamespaceHandler.&lt;init&gt;(SecurityNamespaceHandler.java:65)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
      ... 31 more
  Caused by: java.lang.ClassNotFoundException: org.springframework.security.core.SpringSecurityCoreVersion
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
      ... 37 more
  Jun 19, 2014 3:24:23 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/appServlet/spring-security.xml]; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.security.config.SecurityNamespaceHandler]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
      at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
      at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
      at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
      at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.security.config.SecurityNamespaceHandler]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:105)
      at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:129)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1433)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:185)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
      ... 22 more
  Caused by: java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion
      at org.springframework.security.config.SecurityNamespaceHandler.&lt;init&gt;(SecurityNamespaceHandler.java:65)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
      ... 31 more
  Caused by: java.lang.ClassNotFoundException: org.springframework.security.core.SpringSecurityCoreVersion
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
      ... 37 more
  
  Jun 19, 2014 3:24:23 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error listenerStart
  Jun 19, 2014 3:24:23 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/pms] startup failed due to previous errors
  Jun 19, 2014 3:24:23 PM org.apache.catalina.core.ApplicationContext log
  INFO: Closing Spring root WebApplicationContext
  INFO : org.springframework.web.context.support.XmlWebApplicationContext - Closing Root WebApplicationContext: startup date [Thu Jun 19 15:24:21 IST 2014]; root of context hierarchy
  WARN : org.springframework.web.context.support.XmlWebApplicationContext - Exception thrown from ApplicationListener handling ContextClosedEvent
  java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Thu Jun 19 15:24:21 IST 2014]; root of context hierarchy
      at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:346)
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333)
      at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:880)
      at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)
      at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:551)
      at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
      at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4980)
      at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5626)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  WARN : org.springframework.web.context.support.XmlWebApplicationContext - Exception thrown from LifecycleProcessor on context close
  java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Thu Jun 19 15:24:21 IST 2014]; root of context hierarchy
      at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:359)
      at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:888)
      at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)
      at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:551)
      at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
      at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4980)
      at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5626)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  Jun 19, 2014 3:24:23 PM org.apache.catalina.core.StandardContext listenerStop
  SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
  java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
      at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
      at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:921)
      at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)
      at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:551)
      at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
      at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4980)
      at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5626)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  </code></pre>
  
  <p>And I am using spring 4. version for this, here is my pom.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.tela&lt;/groupId&gt;
      &lt;artifactId&gt;pms&lt;/artifactId&gt;
      &lt;name&gt;PMSbyTela&lt;/name&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0.0-BUILD-SNAPSHOT&lt;/version&gt;
      &lt;properties&gt;
          &lt;java-version&gt;1.7&lt;/java-version&gt;
          &lt;org.springframework-version&gt;4.0.0.RELEASE&lt;/org.springframework-version&gt;
          &lt;org.aspectj-version&gt;1.6.10&lt;/org.aspectj-version&gt;
          &lt;org.slf4j-version&gt;1.6.6&lt;/org.slf4j-version&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
          &lt;!-- Spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;!-- Exclude Commons Logging in favor of SLF4j --&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                      &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
              &lt;version&gt;4.0.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Spring security --&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;3.2.4.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
              &lt;version&gt;3.2.4.RELEASE&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;version&gt;3.2.4.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- AspectJ --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
              &lt;version&gt;${org.aspectj-version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.15&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.mail&lt;/groupId&gt;
                      &lt;artifactId&gt;mail&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.jms&lt;/groupId&gt;
                      &lt;artifactId&gt;jms&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jdmk&lt;/groupId&gt;
                      &lt;artifactId&gt;jmxtools&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jmx&lt;/groupId&gt;
                      &lt;artifactId&gt;jmxri&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;version&gt;4.0.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- @Inject --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.inject&lt;/groupId&gt;
              &lt;artifactId&gt;javax.inject&lt;/artifactId&gt;
              &lt;version&gt;1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Servlet --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Test --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.7&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;3.1.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
              &lt;version&gt;1.2.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;4.1.9.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.6&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- end of orm dependencies for hibernate --&gt;
  
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.9&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;additionalProjectnatures&gt;
                          &lt;projectnature&gt;org.springframework.ide.eclipse.core.springnature&lt;/projectnature&gt;
                      &lt;/additionalProjectnatures&gt;
                      &lt;additionalBuildcommands&gt;
                          &lt;buildcommand&gt;org.springframework.ide.eclipse.core.springbuilder&lt;/buildcommand&gt;
                      &lt;/additionalBuildcommands&gt;
                      &lt;downloadSources&gt;true&lt;/downloadSources&gt;
                      &lt;downloadJavadocs&gt;true&lt;/downloadJavadocs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                      &lt;compilerArgument&gt;-Xlint:all&lt;/compilerArgument&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                      &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.2.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;mainClass&gt;org.test.int1.Main&lt;/mainClass&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>My spring sercurity xml file.</p>
  
  <pre><code>&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.2.xsd"&gt;
  
              &lt;http auto-config="true"&gt;
                          &lt;intercept-url pattern="/confidential" access="ROLE_USER" /&gt;
              &lt;/http&gt;
  
              &lt;authentication-manager&gt;
                          &lt;authentication-provider&gt;
                                      &lt;user-service&gt;
                                                  &lt;user name="yolo" password="123" authorities="ROLE_USER" /&gt;
                                      &lt;/user-service&gt;
                          &lt;/authentication-provider&gt;
              &lt;/authentication-manager&gt;
  
  &lt;/beans:beans&gt;
  </code></pre>
  
  <p>I can not find what is the error of it. I just needed to add Login and Logout functionality and validation to it. </p>
  
  <p>Help would be really appreciated.</p>