title: Spring JPA/Hibernate: Failed to import bean definitions
body: <p>Beating my head against the wall for hours and can't resolve this issue, seems to be either a mistake in my config setup or maybe a dependency conflict or missing dependency. Any thoughts?</p>
  
  <p><strong>Relevant dependencies:</strong> </p>
  
  <pre><code>Spring Data Commons Core 1.2.0
  Spring Data JPA 1.8.0
  Hibernate Core 5.0
  Hibernate JPA 2.1
  </code></pre>
  
  <p><strong>Error message in Eclipse:</strong></p>
  
  <pre><code>Configuration problem: Failed to import bean definitions from relative location [SpringDbContext.xml] Offending resource: class path resource [SpringAppContext.xml]; nested exception is 
  org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 43 in XML document from class path resource [SpringDbContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: 
  http://www.springframework.org/schema/data/jpa/spring-jpa-1.8.xsd; lineNumber: 43; columnNumber: 63; src-resolve: Cannot resolve the name 'repository:auditing-attributes' to a(n) 'attribute group' component.at 
  org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
  </code></pre>
  
  <p><strong>SpringAppContext.xml:</strong></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"
             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-3.2.xsd"&gt;
  
      &lt;import resource="SpringWebContext.xml"/&gt;
      &lt;import resource="SpringDbContext.xml"/&gt;
      &lt;import resource="SpringSecurityContext.xml"/&gt;
      &lt;import resource="SpringSocialContext.xml"/&gt;
  
      &lt;context:component-scan base-package="com.metagravy.ark.security"/&gt;
  
      &lt;bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
          &lt;property name="basename" value="i18n/messages"/&gt;
          &lt;property name="useCodeAsDefaultMessage" value="true"/&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>Hibernate configs:</strong></p>
  
  <pre><code>hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
  hibernate.format_sql=true
  hibernate.hbm2ddl.auto=create-drop
  hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
  hibernate.show_sql=false
  </code></pre>
  
  <p><strong>SpringDbContext.xml:</strong></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:jpa="http://www.springframework.org/schema/data/jpa"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/beans 
                             http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
                             http://www.springframework.org/schema/data/jpa 
                             http://www.springframework.org/schema/data/jpa/spring-jpa-1.8.xsd
                             http://www.springframework.org/schema/tx 
                             http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
                             http://www.springframework.org/schema/context 
                             http://www.springframework.org/schema/context/spring-context-4.1.xsd"&gt;
  
      &lt;context:property-placeholder location="classpath:application.properties"/&gt;
  
      &lt;bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource"&gt;
          &lt;property name="driverClass" value="${db.driver}"/&gt;
          &lt;property name="jdbcUrl" value="${db.url}"/&gt;
          &lt;property name="username" value="${db.username}"/&gt;
          &lt;property name="password" value="${db.password}"/&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
          &lt;property name="entityManagerFactory" ref="entityManagerFactory"/&gt;
      &lt;/bean&gt;
  
      &lt;tx:annotation-driven/&gt;
  
      &lt;bean id="hibernateJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/&gt;
  
      &lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource"/&gt;
          &lt;property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/&gt;
          &lt;property name="packagesToScan" value="com.metagravy.ark"/&gt;
          &lt;property name="jpaProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;${hibernate.dialect}&lt;/prop&gt;
                  &lt;prop key="hibernate.ejb.naming_strategy"&gt;${hibernate.ejb.naming_strategy}&lt;/prop&gt;
                  &lt;prop key="hibernate.format_sql"&gt;${hibernate.format_sql}&lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;${hibernate.hbm2ddl.auto}&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;jpa:repositories base-package="com.metagravy.ark.security"/&gt;
  
  
  &lt;/beans&gt;
  </code></pre>