title: Changing set of jars for Spring MVC application resulted in java.lang.NoSuchMethodError error
body: <p>I have working Spring WEB MVC application.   I need to add Hibernate persistence layer, so I downloaded Spring Pet Clinic application from Github:
  <a href="http://spring.io/blog/2013/03/21/spring-petclinic-is-on-github" rel="nofollow">http://spring.io/blog/2013/03/21/spring-petclinic-is-on-github</a></p>
  
  <p>Only changing jars to the set of jars from the Petclinic application (Spring version 4.0.1) results in the following error </p>
  
  <pre><code>12:38:54.039 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory -   Creating shared instance of singleton bean 'viewResolver'
  12:38:54.039 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'viewResolver'
  12:38:54.061 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed
  java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata.needsRefresh(Lorg/springframework/beans/factory/annotation/InjectionMetadata;Ljava/lang/Class;)Z
  at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:383) ~[spring-orm-4.0.1.RELEASE.jar:4.0.1.RELEASE]
  at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:332) ~[spring-orm-4.0.1.RELEASE.jar:4.0.1.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:844) ~[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE]
  </code></pre>