title: java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z
body: <p>When I upgraded my tomcat from 7 to 8.5 and jdk from 7 to 8, I am getting below errors while starting my tomcat.</p>
  
  <p>Spring version: 4.1.8.RELEASE</p>
  
  <p>I changed below pom entries too, but nothing seems to be working. Please have a look and let me know what I need to do to resolve this issue.</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.oracle&lt;/groupId&gt;
          &lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
          &lt;version&gt;11.2.0.3&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>to </p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.oracle&lt;/groupId&gt;
          &lt;artifactId&gt;ojdbc7&lt;/artifactId&gt;
          &lt;version&gt;12.1.0.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat-dbcp&lt;/artifactId&gt;
          &lt;version&gt;7.0.47&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat-dbcp&lt;/artifactId&gt;
          &lt;version&gt;8.5.4&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>The <code>entityManagerFactory()</code></p>
  
  <pre><code> @Bean
   public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
          LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
          entityManagerFactoryBean.setDataSource(dataSource());
          entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistenceProvider.class);
          entityManagerFactoryBean.setPackagesToScan(new String[] {"com.rest.entity" });
          entityManagerFactoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
          entityManagerFactoryBean.setJpaProperties(hibernateProperties());
  
          return entityManagerFactoryBean;
      }
  
  private Properties hibernateProperties() {
          Properties properties = new Properties();
          properties.put("hibernate.dialect", "org.hibernate.dialect.OracleDialect");
          properties.put("hibernate.cache.provider_class", "org.hibernate.cache.NoCacheProvider");
          properties.put("hibernate.current_session_context_class","thread");
          properties.put("hibernate.show_sql", "false");
          properties.put("hibernate.hbm2ddl.auto", "update");
          return properties;
      }
  </code></pre>
  
  <p>Tomcat stdErr.logs</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/rest/configuration/JPAConfiguration.class]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1572)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)          at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:960)          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:749)          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)          at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:664)         at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:536)            at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:490)          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
          at javax.servlet.GenericServlet.init(GenericServlet.java:158)       at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)          at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)          at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4931)            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5241)            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)            at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)         at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)          at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z          at org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:924)         at org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:282)        at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:359)        at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2316)        at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2299)          at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2043)         at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1543)            at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139)         at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:279)           at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:124)         at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)          at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)           at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)          at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885)          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)         at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityanagerFactoryBuilderImpl.java:850)           at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)          at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)           at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)          at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60)          at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)         at rg.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)        ... 29 more
              Jul 28, 2017 12:18:33 PM org.apache.catalina.core.StandardContext loadOnStartup
      SEVERE: Servlet [dispatcher] in web application [/TGARest] threw load() exception        java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z            at org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:924)         at org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:282)            at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:359)            at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2316)            at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2299)          at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2043)         at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1543)        at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139)
          at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:279)           at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:124)         at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)          at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)           at 
  </code></pre>