title: How solve Servlet Context Error into Spring?
body: <p>I'm trying to develop a new Spring web app, but I have a problem with configuration..</p>
  
  <pre><code>ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'emf' defined in ServletContext resource [/WEB-INF/spring/jpa-tx-config.xml]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:973)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:750)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:586)
      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1750)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      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:745)
  Caused by: java.lang.AbstractMethodError
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:278)
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802)
      at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135)
      at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:336)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
      ... 25 more
  </code></pre>
  
  <p>This is my <code>jpa-tx-config.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:jpa="http://www.springframework.org/schema/data/jpa"
      xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
     http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
     http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"&gt;
  
      &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
          &lt;property name="entityManagerFactory" ref="emf"/&gt;
      &lt;/bean&gt;
  
      &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;
  
      &lt;bean id="emf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
          &lt;property name="jpaVendorAdapter"&gt;
              &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /&gt;
          &lt;/property&gt;
          &lt;property name="packagesToScan" value="my.domain"/&gt;
  
          &lt;property name="persistenceUnitName" value="persistenceUnit"/&gt;
          &lt;property name="jpaProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQL5InnoDBDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt; 
                  &lt;prop key="hibernate.ejb.naming_strategy"&gt;org.hibernate.cfg.ImprovedNamingStrategy&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.charSet"&gt;UTF-8&lt;/prop&gt;
  
                  &lt;prop key="hibernate.max_fetch_depth"&gt;3&lt;/prop&gt;
                  &lt;prop key="hibernate.jdbc.fetch_size"&gt;50&lt;/prop&gt;
                  &lt;prop key="hibernate.jdbc.batch_size"&gt;20&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;false&lt;/prop&gt;
                  &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
  
                  &lt;prop key="org.hibernate.envers.audit_table_suffix"&gt;_H&lt;/prop&gt;
                  &lt;prop key="org.hibernate.envers.revision_field_name"&gt;AUDIT_REVISION&lt;/prop&gt;
                  &lt;prop key="org.hibernate.envers.revision_type_field_name"&gt;ACTION_TYPE&lt;/prop&gt;
                  &lt;prop key="org.hibernate.envers.audit_strategy"&gt;org.hibernate.envers.strategy.ValidityAuditStrategy&lt;/prop&gt;
                  &lt;prop key="org.hibernate.envers.audit_strategy_validity_end_rev_field_name"&gt;AUDIT_REVISION_END&lt;/prop&gt;
                  &lt;prop key="org.hibernate.envers.audit_strategy_validity_store_revend_timestamp"&gt;True&lt;/prop&gt;
                  &lt;prop key="org.hibernate.envers.audit_strategy_validity_revend_timestamp_field_name"&gt;AUDIT_REVISION_END_TS&lt;/prop&gt;               
                  &lt;prop key="jadira.usertype.databaseZone"&gt;jvm&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;jpa:repositories base-package="my.repository" entity-manager-factory-ref="emf"
          transaction-manager-ref="transactionManager"/&gt;
  
      &lt;jpa:auditing auditor-aware-ref="auditorAwareBean" /&gt;
  
      &lt;bean id="auditorAwareBean" class="it.cpmapave.ped.auditor.AuditorAwareBean"/&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>I think it is correct.. </p>
  
  <p>How can I solve it?</p>
  
  <p><strong>EDIT</strong>
  Add a piece of my pom, maybe can help to understand why.</p>
  
  <p>These are my dependency's version:</p>
  
  <pre><code>&lt;jsp.version&gt;2.2&lt;/jsp.version&gt;
  &lt;jstl.version&gt;1.2&lt;/jstl.version&gt;
  &lt;servlet.version&gt;2.5&lt;/servlet.version&gt;
  
  &lt;!-- Spring --&gt;
  &lt;org.springframework-version&gt;4.0.2.RELEASE&lt;/org.springframework-version&gt;
  &lt;org.springsecurity-version&gt;4.0.2.RELEASE&lt;/org.springsecurity-version&gt;
  &lt;spring-data-jpa.version&gt;1.7.2.RELEASE&lt;/spring-data-jpa.version&gt;
  
  &lt;!-- Hibernate / JPA --&gt;
  &lt;hibernate.version&gt;5.0.0.Final&lt;/hibernate.version&gt;
  &lt;hibernate.validator.version&gt;5.0.0.Final&lt;/hibernate.validator.version&gt;
  
  &lt;!-- Jackson --&gt;
  &lt;jackson.version&gt;2.2.2&lt;/jackson.version&gt;
  
  &lt;!-- QueryDSL --&gt;
  &lt;querydsl.version&gt;3.3.2&lt;/querydsl.version&gt;
  </code></pre>