Dans mon projet, j'ai commencé à utiliser c3p0 avec hibernate pour se reconnecter à la base de données, car hibernate ne restaurera pas la connexion en cas d'échec de la base de données.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>5.2.9.Final</version>
</dependency>
J'utilise la version hibernate:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.9.Final</version>
</dependency>
le pilote postgresql est:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.1.4</version>
</dependency>
la configuration de c3p0 est:
properties.put("hibernate.c3p0.preferredTestQuery","SELECT 1");
properties.put("hibernate.c3p0.testConnectionOnCheckout","true");
properties.put("hibernate.c3p0.acquireRetryAttempts","1");
properties.put("hibernate.c3p0.acquireIncrement","1");
properties.put("hibernate.c3p0.idleConnectionTestPeriod","60");
mais je continue à avoir cette erreur:
18:25:32.910 [localhost-startStop-1] DEBUG c.m.v2.c3p0.impl.NewPooledConnection - com.mchange.v2.c3p0.impl.NewPooledConnection@755e3afe handling a throwable.
Java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
at org.postgresql.Driver.notImplemented(Driver.Java:669) ~[postgresql-42.1.4.jar:42.1.4]
at org.postgresql.jdbc.PgConnection.createClob(PgConnection.Java:1246) ~[postgresql-42.1.4.jar:42.1.4]
at com.mchange.v2.c3p0.impl.NewProxyConnection.createClob(NewProxyConnection.Java:1408) ~[c3p0-0.9.5.2.jar:0.9.5.2]
at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62) ~[na:1.8.0_121]
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43) ~[na:1.8.0_121]
at Java.lang.reflect.Method.invoke(Method.Java:498) ~[na:1.8.0_121]
at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.useContextualLobCreation(LobCreatorBuilderImpl.Java:113) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.makeLobCreatorBuilder(LobCreatorBuilderImpl.Java:54) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl.<init>(JdbcEnvironmentImpl.Java:271) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.Java:114) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.Java:35) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.Java:88) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.Java:259) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.Java:233) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.Java:210) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.Java:51) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.Java:94) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.Java:242) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.Java:210) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.Java:352) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.Java:111) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.Java:858) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.Java:885) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.Java:60) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.Java:353) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.Java:370) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.Java:359) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.Java:1687) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.Java:1624) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.Java:555) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.Java:483) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.Java:306) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.Java:230) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.Java:302) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.Java:197) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.Java:1081) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.Java:856) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.Java:542) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.Java:443) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.Java:325) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.Java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.Apache.catalina.core.StandardContext.listenerStart(StandardContext.Java:4971) [catalina.jar:7.0.53]
at org.Apache.catalina.core.StandardContext.startInternal(StandardContext.Java:5467) [catalina.jar:7.0.53]
at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:150) [catalina.jar:7.0.53]
at org.Apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.Java:901) [catalina.jar:7.0.53]
at org.Apache.catalina.core.ContainerBase.addChild(ContainerBase.Java:877) [catalina.jar:7.0.53]
at org.Apache.catalina.core.StandardHost.addChild(StandardHost.Java:632) [catalina.jar:7.0.53]
at org.Apache.catalina.startup.HostConfig.deployWAR(HostConfig.Java:1073) [catalina.jar:7.0.53]
at org.Apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.Java:1857) [catalina.jar:7.0.53]
at Java.util.concurrent.Executors$RunnableAdapter.call(Executors.Java:511) [na:1.8.0_121]
at Java.util.concurrent.FutureTask.run(FutureTask.Java:266) [na:1.8.0_121]
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142) [na:1.8.0_121]
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617) [na:1.8.0_121]
at Java.lang.Thread.run(Thread.Java:745) [na:1.8.0_121]
18:25:32.911 [localhost-startStop-1] DEBUG com.mchange.v2.sql.SqlUtils - Attempted to convert SQLException to SQLException. Leaving it alone. [SQLState: 0A000; errorCode: 0]
Java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
at org.postgresql.Driver.notImplemented(Driver.Java:669) ~[postgresql-42.1.4.jar:42.1.4]
at org.postgresql.jdbc.PgConnection.createClob(PgConnection.Java:1246) ~[postgresql-42.1.4.jar:42.1.4]
at com.mchange.v2.c3p0.impl.NewProxyConnection.createClob(NewProxyConnection.Java:1408) ~[c3p0-0.9.5.2.jar:0.9.5.2]
at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62) ~[na:1.8.0_121]
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43) ~[na:1.8.0_121]
at Java.lang.reflect.Method.invoke(Method.Java:498) ~[na:1.8.0_121]
at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.useContextualLobCreation(LobCreatorBuilderImpl.Java:113) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.makeLobCreatorBuilder(LobCreatorBuilderImpl.Java:54) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl.<init>(JdbcEnvironmentImpl.Java:271) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.Java:114) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.Java:35) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.Java:88) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.Java:259) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.Java:233) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.Java:210) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.Java:51) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.Java:94) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.Java:242) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.Java:210) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.Java:352) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.Java:111) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.Java:858) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.Java:885) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.Java:60) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.Java:353) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.Java:370) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.Java:359) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.Java:1687) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.Java:1624) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.Java:555) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.Java:483) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.Java:306) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.Java:230) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.Java:302) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.Java:197) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.Java:1081) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.Java:856) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.Java:542) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.Java:443) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.Java:325) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.Java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.Apache.catalina.core.StandardContext.listenerStart(StandardContext.Java:4971) [catalina.jar:7.0.53]
at org.Apache.catalina.core.StandardContext.startInternal(StandardContext.Java:5467) [catalina.jar:7.0.53]
at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:150) [catalina.jar:7.0.53]
at org.Apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.Java:901) [catalina.jar:7.0.53]
at org.Apache.catalina.core.ContainerBase.addChild(ContainerBase.Java:877) [catalina.jar:7.0.53]
at org.Apache.catalina.core.StandardHost.addChild(StandardHost.Java:632) [catalina.jar:7.0.53]
at org.Apache.catalina.startup.HostConfig.deployWAR(HostConfig.Java:1073) [catalina.jar:7.0.53]
at org.Apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.Java:1857) [catalina.jar:7.0.53]
at Java.util.concurrent.Executors$RunnableAdapter.call(Executors.Java:511) [na:1.8.0_121]
at Java.util.concurrent.FutureTask.run(FutureTask.Java:266) [na:1.8.0_121]
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142) [na:1.8.0_121]
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617) [na:1.8.0_121]
at Java.lang.Thread.run(Thread.Java:745) [na:1.8.0_121]
18:25:32.912 [localhost-startStop-1] DEBUG c.m.v.c.impl.DefaultConnectionTester - Testing a Connection in response to an Exception:
Java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
at org.postgresql.Driver.notImplemented(Driver.Java:669) ~[postgresql-42.1.4.jar:42.1.4]
at org.postgresql.jdbc.PgConnection.createClob(PgConnection.Java:1246) ~[postgresql-42.1.4.jar:42.1.4]
at com.mchange.v2.c3p0.impl.NewProxyConnection.createClob(NewProxyConnection.Java:1408) ~[c3p0-0.9.5.2.jar:0.9.5.2]
at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62) ~[na:1.8.0_121]
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43) ~[na:1.8.0_121]
at Java.lang.reflect.Method.invoke(Method.Java:498) ~[na:1.8.0_121]
at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.useContextualLobCreation(LobCreatorBuilderImpl.Java:113) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.makeLobCreatorBuilder(LobCreatorBuilderImpl.Java:54) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl.<init>(JdbcEnvironmentImpl.Java:271) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.Java:114) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.Java:35) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.Java:88) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.Java:259) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.Java:233) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.Java:210) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.Java:51) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.Java:94) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.Java:242) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.Java:210) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.Java:352) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.Java:111) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.Java:858) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.Java:885) [hibernate-core-5.2.9.Final.jar:5.2.9.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.Java:60) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.Java:353) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.Java:370) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.Java:359) [spring-orm-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.Java:1687) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.Java:1624) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.Java:555) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.Java:483) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.Java:306) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.Java:230) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.Java:302) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.Java:197) [spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.Java:1081) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.Java:856) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.Java:542) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.Java:443) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.Java:325) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.Java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.Apache.catalina.core.StandardContext.listenerStart(StandardContext.Java:4971) [catalina.jar:7.0.53]
at org.Apache.catalina.core.StandardContext.startInternal(StandardContext.Java:5467) [catalina.jar:7.0.53]
at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:150) [catalina.jar:7.0.53]
at org.Apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.Java:901) [catalina.jar:7.0.53]
at org.Apache.catalina.core.ContainerBase.addChild(ContainerBase.Java:877) [catalina.jar:7.0.53]
at org.Apache.catalina.core.StandardHost.addChild(StandardHost.Java:632) [catalina.jar:7.0.53]
at org.Apache.catalina.startup.HostConfig.deployWAR(HostConfig.Java:1073) [catalina.jar:7.0.53]
at org.Apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.Java:1857) [catalina.jar:7.0.53]
at Java.util.concurrent.Executors$RunnableAdapter.call(Executors.Java:511) [na:1.8.0_121]
at Java.util.concurrent.FutureTask.run(FutureTask.Java:266) [na:1.8.0_121]
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142) [na:1.8.0_121]
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617) [na:1.8.0_121]
at Java.lang.Thread.run(Thread.Java:745) [na:1.8.0_121]
Je dois noter que je n'appelle pas createClob()
moi-même!
Alors, que dois-je changer pour me débarrasser de cette erreur lors du démarrage de Tomcat 7? J'ai également effacé le pilote postgresql du répertoire lib de Tomcat.
Placez hibernate.jdbc.lob.non_contextual_creation=true
sur votre persistence.xml
Juste au cas où quelqu'un trouverait ce fil à la recherche du bogue équivalent à postgresql:
Java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
application.properties:
# disable driver's feature detection
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false
# without detection you have to set the dialect by hand
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
BTW: Spring Boot 2.0.0.RELEASE utilise une version de pilote postgresql cassée, je devais spécifier 42.2.0 pour que le pilote soit chargé du tout:
Caused by: Java.lang.RuntimeException: Failed to load driver class org.postgresql.Driver in either of HikariConfig class loader or Thread context classloader
UPDATE 2018-03-01:
Selon ce problème, le Stacktrace est considéré comme un avertissement et peut être ignoré
https://github.com/spring-projects/spring-boot/issues/12007#issuecomment-369388646
UPDATE 2018-03-13:
Il existe désormais un rapport de bogue officiel: https://hibernate.atlassian.net/browse/HHH-12368
Dans Spring Boot, définissez cette propriété sur application.properties corrigez le problème:
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true