title: java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes
body: <p>guys.I am new here.</p>
  
  <p>I try to run a simple <code>JUnit</code> test case for <code>spring</code> service class and <code>dao</code> class, but it fails and I get this exception. It is a <code>maven</code> project and I use the <code>tomcat v7.0</code>. </p>
  
  <p>I will show the Failure trace in following .It has no console.</p>
  
  <p>Please Help。</p>
  
  <pre><code>java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes(java/lang/reflect/Annotateenter Element;java/lang/String;)
  org/springframework/core/annotation/AnnotationAttributes;
          at org.springframework.test.util.Menter code hereetaAnnotationUtils$AnnotationDescriptor.&lt;init&gt;(MetaAnnotationUtils.java:289)
          at org.springframework.test.util.MetaAnnotationUtils$UntypedAnnotationDescriptor.&lt;init&gt;(MetaAnnotationUtils.java:349)
          at org.springframework.test.util.MetaAnnotationUtils$UntypedAnnotationDescriptor.&lt;init&gt;(MetaAnnotationUtils.java:344)
          at org.springframework.test.util.MetaAnnotationUtils.findAnnotationDescriptorForTypes(MetaAnnotationUtils.java:191)
          at org.springframework.test.util.MetaAnnotationUtils.findAnnotationDescriptorForTypes(MetaAnnotationUtils.java:208)
          at org.springframework.test.util.MetaAnnotationUtils.findAnnotationDescriptorForTypes(MetaAnnotationUtils.java:166)
          at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:271)
          at org.springframework.test.context.DefaultTestContext.&lt;init&gt;(DefaultTestContext.java:67)
          at org.springframework.test.context.TestContextManager.&lt;init&gt;(TestContextManager.java:103)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:124)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.&lt;init&gt;(SpringJUnit4ClassRunner.java:115)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
          at java.lang.reflect.Constructor.newInstance(Unknown Source)
          at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
          at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
          at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
          at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
          at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
          at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
  </code></pre>
  
  <p>The following is my maven project's <strong>pom.xml</strong>.</p>
  
  <pre><code>&lt;dependencies&gt;
          &lt;!-- junit test --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.12&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- 4)Spring test --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- 1. --&gt;
          &lt;!-- slf4j --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
              &lt;version&gt;1.2.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- 2.mysql --&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.37&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;c3p0&lt;/groupId&gt;
              &lt;artifactId&gt;c3p0&lt;/artifactId&gt;
              &lt;version&gt;0.9.1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- DAO: MyBatis --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mybatis&lt;/groupId&gt;
              &lt;artifactId&gt;mybatis&lt;/artifactId&gt;
              &lt;version&gt;3.4.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mybatis&lt;/groupId&gt;
              &lt;artifactId&gt;mybatis-spring&lt;/artifactId&gt;
              &lt;version&gt;1.3.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- 3.Servlet web --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;taglibs&lt;/groupId&gt;
              &lt;artifactId&gt;standard&lt;/artifactId&gt;
              &lt;version&gt;1.1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;jstl&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- json --&gt;
          &lt;!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
              &lt;version&gt;2.8.7&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
          &lt;/dependency&gt;
  
  
      &lt;!-- 4.Spring --&gt;
      &lt;!-- 1)Spring core --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;5.0.6.RELEASE&lt;/version&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;5.0.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- &lt;dependency&gt; &lt;groupId&gt;org.springframework&lt;/groupId&gt; &lt;artifactId&gt;spring-context&lt;/artifactId&gt; 
          &lt;version&gt;${spring.version}&lt;/version&gt; &lt;/dependency&gt; --&gt;
      &lt;!-- https://mvnrepository.com/artifact/org.springframework/spring-context --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;5.0.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- 2)Spring DAO --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
          &lt;version&gt;5.0.6.RELEASE&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;5.0.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- 3)Spring web --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
          &lt;version&gt;5.0.6.RELEASE&lt;/version&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;5.0.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- redis:Jedis --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;redis.clients&lt;/groupId&gt;
          &lt;artifactId&gt;jedis&lt;/artifactId&gt;
          &lt;version&gt;2.9.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.dyuproject.protostuff&lt;/groupId&gt;
          &lt;artifactId&gt;protostuff-core&lt;/artifactId&gt;
          &lt;version&gt;1.0.12&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.dyuproject.protostuff&lt;/groupId&gt;
          &lt;artifactId&gt;protostuff-runtime&lt;/artifactId&gt;
          &lt;version&gt;1.0.12&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Looking forward to your quick answer.Thanks!</p>