it-swarm.com.de

hibernate with c3p0: createClob () ist noch nicht implementiert

In meinem Projekt habe ich begonnen, c3p0 mit Hibernate zu verwenden, um die Verbindung zur Datenbank wiederherzustellen, da der Hibernate die Verbindung bei einem Ausfall der Datenbank nicht wiederherstellt.

<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-c3p0</artifactId>
            <version>5.2.9.Final</version>
</dependency>

Ich verwende die Version des Ruhezustands:

<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.2.9.Final</version>
</dependency>

der Postgresql-Treiber ist:

<dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.1.4</version>
</dependency>

c3p0 Konfiguration ist:

 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");

aber ich bekomme immer diesen Fehler:

18:25:32.910 [localhost-startStop-1] DEBUG c.m.v2.c3p0.impl.NewPooledConnection - [email protected] 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]

Ich muss beachten, dass ich selbst nicht createClob() anrufe!

Was sollte ich also ändern, um diesen Fehler beim Starten von Tomcat 7 zu beseitigen? Ich habe auch den Postgresql-Treiber aus Tomcat's lib dir gelöscht.

13
greengold

Setze hibernate.jdbc.lob.non_contextual_creation=true in deinen persistence.xml

13
fn.

Nur für den Fall, dass jemand diesen Thread auf der Suche nach dem entsprechenden Postgresql-Fehler findet:

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

Übrigens: Spring Boot 2.0.0.RELEASE verwendet eine defekte Postgresql-Treiberversion, ich musste 42.2.0 angeben, damit der Treiber überhaupt geladen wird:

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:

Demnach wird das Stacktrace als Warnung betrachtet und kann ignoriert werden.

https://github.com/spring-projects/spring-boot/issues/12007#issuecomment-369388646

UPDATE 2013.03.03:

Es gibt jetzt einen offiziellen Fehlerbericht: https://hibernate.atlassian.net/browse/HHH-12368

26
lilalinux

Wenn Sie diese Eigenschaft in Spring Boot auf application.properties setzen, beheben Sie das Problem:

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
0