启动 Spring 启动应用程序时,我收到:
原因:java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() 尚未实现。
我知道这与我现在正在使用的Postgresql驱动程序中的某些问题有关。
许多人解决了这个问题,只需将以下行放在application.properties文件中:
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=真
我仍然有同样的问题。还有其他提示吗?如果考虑查看具有当前配置的项目:https://github.com/caliari77/hiRank
经过一些测试,我可以解决这个问题。似乎缺少Hibernate实现,因此为了解决此问题,我将其添加到gradle.build文件中。我以为 Spring-boot 在获得 JPA 时已经处理好了它,但我错了。这是我从gradle.build更新的依赖项:
dependencies {
//Spring
//implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
//runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
//Hibernate
implementation 'org.hibernate:hibernate-core:5.4.2.Final'
implementation 'org.hibernate:hibernate-entitymanager:5.4.2.Final'
//Postgres
implementation 'org.postgresql:postgresql:42.2.5.jre7'
//Gson
implementation 'com.google.code.gson:gson:2.8.5'
//Logger
implementation 'log4j:log4j:1.2.17'
}
尝试添加
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true