title: Maven/Spring/Hibernate NoSuchMethodError: org.hibernate.engine.jdbc.spi.JdbcServices.getConnectionProvider()
body: <p>First, I don't usually work with Java, but have in the past, so I'm a little bit out of my comfort zone. I have a Spring and Hibernate project that I'm working on, and it has a fatal error when starting. I can clone this same repo to another Macbook Pro (same as this one) and import into eclipse, maven clean install, run on server (tomcat config) and it works.</p>
  
  <pre><code>Jan 20, 2016 3:45:34 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mssqlEntityManagerFactory' defined in class path resource [applicationContext-mssql.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.engine.jdbc.spi.JdbcServices.getConnectionProvider()Lorg/hibernate/engine/jdbc/connections/spi/ConnectionProvider;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
      at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:741)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mssqlEntityManagerFactory' defined in class path resource [applicationContext-mssql.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.engine.jdbc.spi.JdbcServices.getConnectionProvider()Lorg/hibernate/engine/jdbc/connections/spi/ConnectionProvider;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:438)
      at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:277)
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.&lt;init&gt;(PersistenceExceptionTranslationInterceptor.java:79)
      at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.&lt;init&gt;(PersistenceExceptionTranslationAdvisor.java:71)
      at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:84)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1532)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1500)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
      ... 19 more
  Caused by: java.lang.NoSuchMethodError: org.hibernate.engine.jdbc.spi.JdbcServices.getConnectionProvider()Lorg/hibernate/engine/jdbc/connections/spi/ConnectionProvider;
      at org.jadira.usertype.spi.shared.AbstractUserTypeHibernateIntegrator.use42Api(AbstractUserTypeHibernateIntegrator.java:80)
      at org.jadira.usertype.spi.shared.AbstractUserTypeHibernateIntegrator.integrate(AbstractUserTypeHibernateIntegrator.java:61)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:306)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1744)
      at org.hibernate.ejb.EntityManagerFactoryImpl.&lt;init&gt;(EntityManagerFactoryImpl.java:94)
      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
      at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
      at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:290)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
      ... 34 more
  </code></pre>
  
  <p>Tomcat 7.0.64</p>
  
  <p>Maven Dependency Tree</p>
  
  <pre><code>$ mvn dependency:tree
  
  [INFO] +- commons-lang:commons-lang:jar:2.4:compile
  [INFO] +- commons-codec:commons-codec:jar:1.6:compile
  [INFO] +- javax.servlet:servlet-api:jar:2.5:provided
  [INFO] +- org.springframework.ldap:spring-ldap-core:jar:2.0.2.RELEASE:compile
  [INFO] |  +- org.springframework.data:spring-data-commons:jar:1.6.1.RELEASE:compile
  [INFO] |  \- org.springframework:spring-beans:jar:3.2.8.RELEASE:compile
  [INFO] +- org.springframework.ldap:spring-ldap-odm:jar:2.0.2.RELEASE:compile
  [INFO] |  +- org.freemarker:freemarker:jar:2.3.9:compile
  [INFO] |  +- commons-cli:commons-cli:jar:1.2:compile
  [INFO] |  \- org.springframework.ldap:spring-ldap-core-tiger:jar:2.0.2.RELEASE:compile
  [INFO] +- joda-time:joda-time:jar:2.5:compile
  [INFO] +- org.apache.commons:commons-math3:jar:3.3:compile
  [INFO] +- org.apache.commons:commons-collections4:jar:4.0:compile
  [INFO] +- org.jadira.usertype:usertype.core:jar:3.2.0.GA:compile
  [INFO] |  +- org.slf4j:slf4j-api:jar:1.7.6:compile
  [INFO] |  \- org.jadira.usertype:usertype.spi:jar:3.2.0.GA:compile
  [INFO] +- com.mandrillapp.wrapper.lutung:lutung:jar:0.0.4:compile
  [INFO] |  +- com.google.code.gson:gson:jar:2.2.2:compile
  [INFO] |  \- org.apache.commons:commons-io:jar:1.3.2:compile
  [INFO] +- org.springframework.security:spring-security-core:jar:3.2.3.RELEASE:compile
  [INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
  [INFO] |  +- org.springframework:spring-aop:jar:3.2.8.RELEASE:compile
  [INFO] |  \- org.springframework:spring-expression:jar:3.2.8.RELEASE:compile
  [INFO] +- org.springframework.security:spring-security-config:jar:3.2.3.RELEASE:compile
  [INFO] +- org.springframework.security:spring-security-ldap:jar:3.2.3.RELEASE:compile
  [INFO] +- org.springframework.security.oauth:spring-security-oauth2:jar:2.0.5.RELEASE:compile
  [INFO] |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
  [INFO] |     \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
  [INFO] +- org.springframework.ws:spring-ws-core:jar:2.1.4.RELEASE:compile
  [INFO] |  +- org.springframework.ws:spring-xml:jar:2.1.4.RELEASE:compile
  [INFO] |  +- wsdl4j:wsdl4j:jar:1.6.1:compile
  [INFO] |  \- javax.xml.stream:stax-api:jar:1.0-2:compile
  [INFO] +- org.springframework:spring-oxm:jar:3.2.4.RELEASE:compile
  [INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.6:compile
  [INFO] +- org.slf4j:log4j-over-slf4j:jar:1.7.6:compile
  [INFO] +- org.slf4j:jul-to-slf4j:jar:1.7.6:compile
  [INFO] +- ch.qos.logback:logback-classic:jar:1.1.2:compile
  [INFO] |  \- ch.qos.logback:logback-core:jar:1.1.2:compile
  [INFO] \- org.glassfish.jersey.media:jersey-media-multipart:jar:2.15:compile
  [INFO]    +- org.glassfish.jersey.core:jersey-common:jar:2.15:compile
  [INFO]    |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
  [INFO]    |  +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.15:compile
  [INFO]    |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
  [INFO]    \- org.jvnet.mimepull:mimepull:jar:1.9.3:compile
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 1:49.357s
  [INFO] Finished at: Thu Jan 21 11:15:00 EST 2016
  [INFO] Final Memory: 18M/307M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>Maven</p>
  
  <pre><code>$ mvn -v
  Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500)
  Maven home: /usr/local/maven
  Java version: 1.8.0_60, vendor: Oracle Corporation
  Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac"
  </code></pre>
  
  <p>Java</p>
  
  <pre><code>$ java -version
  java version "1.8.0_60"
  Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
  Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
  </code></pre>
  
  <p>I took the following steps:</p>
  
  <pre><code>$ git clone http://github.com/repo
  $ cd repo
  $ git checkout branch
  $ mvn clean install
  </code></pre>
  
  <p>I deployed to Tomcat with the web gui and it would not start.
  I cleaned the repo rebuilt everything, and tried from within Eclipse entirely, even having it handle Tomcat, and I get the same result. I deleted the ~/.m2/repository folder several times when cleaning and I always end up with the same error.</p>
  
  <p>On the other machine, it gets this error occasionally and a clean install fixes it. The other machine is running Maven 3.3.3 and Java 1.7.0_79.</p>
  
  <p>Any help would be greatly appreciated.</p>