java - 如何解决 org.postgresql.jdbc.PgConnection.createClob() 尚未实现
问题描述
例外
启动 spring-boot 应用程序时,我收到:
原因:java.sql.SQLFeatureNotSupportedException:方法 org.postgresql.jdbc.PgConnection.createClob() 尚未实现。
我知道这与我现在正在使用的 Postgresql 驱动程序的一些问题有关。
不成功的尝试
许多人解决了这个问题,只需将以下行放在 application.properties 文件中:
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=true
我仍然有同样的问题。它还有其他提示吗?如果考虑使用当前配置查看我的项目: 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'
}
推荐阅读
- python - 合并两个 3d 对象时删除内部信息
- java - 如何在 Java Spark 中转换嵌套结构(不支持的 NullType)
- java - 仅当不在单词内时才从字符串中删除特殊字符
- go - Getting bind: address already in use even after closing the connection in golang
- html - 如何在django中通过css添加背景图片?
- spring - 使用 DeadLetterPublishingRecoverer 处理 Spring-kafka 错误
- javascript - Next.js 通过路径渲染动态内容
- reactjs - axios在reactJS中获取请求
- windows - 如果我使用 runas /netonly 运行 powershell,我如何才能看到“netonly”用户
- excel - 清除所有没有颜色的单元格