org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined
<p>I'm developing Spring MVC, Spring Security example, while developing this code I'm facing the following error: After spending lots of days, still I am not able to resolve this error yet. Please guide me soonest possible. </p>

<pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Factory method 'requestMappingHandlerMapping' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/MethodIntrospector$MetadataLookup
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:835) ~[spring-context-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) [spring-web-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) [spring-web-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.2.2.RELEASE.jar:4.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) [catalina.jar:7.0.59]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524) [catalina.jar:7.0.59]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.59]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) [catalina.jar:7.0.59]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) [catalina.jar:7.0.59]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
</code></pre>

<p>The dependency Tree:</p>

<pre><code>[INFO] ------------------------------------------------------------------------
[INFO] Building spring-security-mvc-persisted-remember-me 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact junit:junit-dep:jar:4.11 has been relocated to junit:junit:jar:4.11
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ spring-security-mvc-persisted-remember-me ---
[WARNING] The artifact junit:junit-dep:jar:4.11 has been relocated to junit:junit:jar:4.11
[INFO] org.baeldung:spring-security-mvc-persisted-remember-me:war:1.0
[INFO] +- org.springframework.security:spring-security-web:jar:4.0.3.RELEASE:compile
[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework.security:spring-security-core:jar:4.0.3.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:4.2.2.RELEASE:compile
[INFO] |  +- org.springframework:spring-context:jar:4.2.2.RELEASE:compile
[INFO] |  +- org.springframework:spring-core:jar:4.2.2.RELEASE:compile
[INFO] |  +- org.springframework:spring-expression:jar:4.2.2.RELEASE:compile
[INFO] |  \- org.springframework:spring-web:jar:4.2.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:4.0.3.RELEASE:compile
[INFO] |  \- org.springframework:spring-aop:jar:4.2.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:4.0.3.RELEASE:compile
[INFO] |  \- org.springframework.security:spring-security-acl:jar:4.0.3.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.2.4.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.2.4.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.2.4.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:4.2.4.RELEASE:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- javax.servlet:jstl:jar:1.2:runtime
[INFO] +- com.h2database:h2:jar:1.4.190:compile
[INFO] +- postgresql:postgresql:jar:9.1-901.jdbc4:runtime
[INFO] +- com.google.guava:guava:jar:19.0:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] |  \- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO] +- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile
[INFO] +- junit:junit:jar:4.11:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] \- org.mockito:mockito-core:jar:1.10.19:test
[INFO]    \- org.objenesis:objenesis:jar:2.1:test
[INFO] ------------------------------------------------------------------------
</code></pre>

<p>pom.xml:</p>

<pre><code>&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/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;org.baeldung&lt;/groupId&gt;
    &lt;artifactId&gt;spring-security-mvc-persisted-remember-me&lt;/artifactId&gt;
    &lt;version&gt;1.0&lt;/version&gt;
    &lt;name&gt;spring-security-mvc-persisted-remember-me&lt;/name&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;


    &lt;properties&gt;
        &lt;!-- Spring --&gt;
        &lt;org.springframework.version&gt;4.2.4.RELEASE&lt;/org.springframework.version&gt;
        &lt;org.springframework.security.version&gt;4.0.3.RELEASE&lt;/org.springframework.security.version&gt;
        &lt;java.version&gt;1.8&lt;/java.version&gt;

        &lt;!-- persistence --&gt;
        &lt;hibernate.version&gt;4.3.11.Final&lt;/hibernate.version&gt;
        &lt;mysql-connector-java.version&gt;5.1.37&lt;/mysql-connector-java.version&gt;
        &lt;h2.version&gt;1.4.190&lt;/h2.version&gt;
        &lt;postgresql.version&gt;9.1-901.jdbc4&lt;/postgresql.version&gt;


        &lt;!-- logging --&gt;
        &lt;org.slf4j.version&gt;1.7.12&lt;/org.slf4j.version&gt;
        &lt;logback.version&gt;1.1.3&lt;/logback.version&gt;

        &lt;!-- various --&gt;
        &lt;hibernate-validator.version&gt;5.1.3.Final&lt;/hibernate-validator.version&gt;
        &lt;javax.servlet.version&gt;3.0.1&lt;/javax.servlet.version&gt;
        &lt;jstl.version&gt;1.2&lt;/jstl.version&gt;

        &lt;!-- util --&gt;
        &lt;guava.version&gt;19.0&lt;/guava.version&gt;
        &lt;commons-lang3.version&gt;3.4&lt;/commons-lang3.version&gt;

        &lt;!-- testing --&gt;
        &lt;org.hamcrest.version&gt;1.3&lt;/org.hamcrest.version&gt;
        &lt;junit.version&gt;4.11&lt;/junit.version&gt;
        &lt;mockito.version&gt;1.10.19&lt;/mockito.version&gt;

        &lt;httpclient.version&gt;4.5&lt;/httpclient.version&gt;
        &lt;httpcore.version&gt;4.4.1&lt;/httpcore.version&gt;

        &lt;rest-assured.version&gt;2.4.1&lt;/rest-assured.version&gt;

        &lt;!-- Maven plugins --&gt;
        &lt;maven-compiler-plugin.version&gt;3.3&lt;/maven-compiler-plugin.version&gt;
        &lt;maven-war-plugin.version&gt;2.5&lt;/maven-war-plugin.version&gt;
        &lt;maven-surefire-plugin.version&gt;2.18.1&lt;/maven-surefire-plugin.version&gt;
        &lt;maven-resources-plugin.version&gt;2.7&lt;/maven-resources-plugin.version&gt;
        &lt;cargo-maven2-plugin.version&gt;1.4.11&lt;/cargo-maven2-plugin.version&gt;

    &lt;/properties&gt;

    &lt;dependencies&gt;

        &lt;!-- Spring Security --&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;${org.springframework.security.version}&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;${org.springframework.security.version}&lt;/version&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;${org.springframework.security.version}&lt;/version&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;${org.springframework.version}&lt;/version&gt;
        &lt;/dependency&gt;

        &lt;!-- Spring --&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-jdbc&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;${org.springframework.version}&lt;/version&gt;
        &lt;/dependency&gt;


        &lt;!-- web --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
            &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
            &lt;version&gt;${javax.servlet.version}&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;${jstl.version}&lt;/version&gt;
            &lt;scope&gt;runtime&lt;/scope&gt;
        &lt;/dependency&gt;

        &lt;!-- persistence --&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;com.h2database&lt;/groupId&gt;
            &lt;artifactId&gt;h2&lt;/artifactId&gt;
            &lt;version&gt;${h2.version}&lt;/version&gt;
        &lt;/dependency&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;postgresql&lt;/groupId&gt;
            &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
            &lt;version&gt;${postgresql.version}&lt;/version&gt;
            &lt;scope&gt;runtime&lt;/scope&gt;
        &lt;/dependency&gt;

        &lt;!-- utils --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
            &lt;artifactId&gt;guava&lt;/artifactId&gt;
            &lt;version&gt;${guava.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;ch.qos.logback&lt;/groupId&gt;
            &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
            &lt;version&gt;${logback.version}&lt;/version&gt;
            &lt;!-- &lt;scope&gt;runtime&lt;/scope&gt; --&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;/dependency&gt;

        &lt;dependency&gt; 
            &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
            &lt;artifactId&gt;log4j-over-slf4j&lt;/artifactId&gt;
            &lt;version&gt;${org.slf4j.version}&lt;/version&gt;
        &lt;/dependency&gt;

        &lt;!-- test scoped --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;junit&lt;/groupId&gt;
            &lt;artifactId&gt;junit-dep&lt;/artifactId&gt;
            &lt;version&gt;${junit.version}&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
            &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt;
            &lt;version&gt;${org.hamcrest.version}&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
            &lt;artifactId&gt;hamcrest-library&lt;/artifactId&gt;
            &lt;version&gt;${org.hamcrest.version}&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;org.mockito&lt;/groupId&gt;
            &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
            &lt;version&gt;${mockito.version}&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;

    &lt;/dependencies&gt;

    &lt;build&gt;
        &lt;finalName&gt;spring-security-mvc-persisted-remember-me&lt;/finalName&gt;
        &lt;resources&gt;
            &lt;resource&gt;
                &lt;directory&gt;src/main/resources&lt;/directory&gt;
                &lt;filtering&gt;true&lt;/filtering&gt;
            &lt;/resource&gt;
        &lt;/resources&gt;

        &lt;plugins&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;${maven-compiler-plugin.version}&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;source&gt;${java.version}&lt;/source&gt;
                    &lt;target&gt;${java.version}&lt;/target&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;

            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                &lt;version&gt;${maven-war-plugin.version}&lt;/version&gt;
            &lt;/plugin&gt;

            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                &lt;version&gt;${maven-surefire-plugin.version}&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;excludes&gt;
                        &lt;!-- &lt;exclude&gt;**/*ProductionTest.java&lt;/exclude&gt; --&gt;
                    &lt;/excludes&gt;
                    &lt;systemPropertyVariables&gt;
                        &lt;!-- &lt;provPersistenceTarget&gt;h2&lt;/provPersistenceTarget&gt; --&gt;
                    &lt;/systemPropertyVariables&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;

            &lt;plugin&gt;
                &lt;groupId&gt;org.codehaus.cargo&lt;/groupId&gt;
                &lt;artifactId&gt;cargo-maven2-plugin&lt;/artifactId&gt;
                &lt;version&gt;${cargo-maven2-plugin.version}&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;wait&gt;true&lt;/wait&gt;
                    &lt;container&gt;
                        &lt;containerId&gt;jetty8x&lt;/containerId&gt;
                        &lt;type&gt;embedded&lt;/type&gt;
                        &lt;systemProperties&gt;
                            &lt;!-- &lt;provPersistenceTarget&gt;cargo&lt;/provPersistenceTarget&gt; --&gt;
                        &lt;/systemProperties&gt;
                    &lt;/container&gt;
                    &lt;configuration&gt;
                        &lt;properties&gt;
                            &lt;cargo.servlet.port&gt;8082&lt;/cargo.servlet.port&gt;
                        &lt;/properties&gt;
                    &lt;/configuration&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;

        &lt;/plugins&gt;

    &lt;/build&gt;
&lt;/project&gt;
</code></pre>