postgresql - 使用 PostgreSQL 字段启动 Spring Boot
问题描述
这是一个简单的 Spring Boot CURD 应用程序。它未能启动。
在 pom.xml 我有: -
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
在 pom 中也有更多的体面。
应用程序属性:-
spring.datasource.url=jdbc:postgresql://localhost:5432/mydb
spring.datasource.username=myuser
spring.datasource.password=mypass
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=create
尝试启动应用程序时,出现以下错误:-
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-07-12 15:29:40 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter -
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:
Property: driverclassname
Value: org.postgresql.Driver
Origin: "driverClassName" from property source "source"
Reason: Failed to load driver class org.postgresql.Driver in either of HikariConfig class loader or Thread context classloader
Action:
Update your application's configuration
我很困惑我错过了什么?请告诉我。提前致谢!
解决方案
推荐阅读
- python - 使用 RQGIS 链接到 QGIS 时如何修复“ImportError: No module named builtins”?
- python - 如何在使用随机时将子列表与其列表匹配?
- php - 如何从左连接表中获取下拉值
- vue.js - 如何在不调用 vue.js 中的方法的情况下从点击中显示项目?
- python - python selenium 无法定位子元素
- python - 使用 pandas df.query() 过滤分类(间隔)列
- yaml - 在 _config.yml 中创建 pdf 链接的语法是什么
- c++ - C++ 从另一个 C++ 文件“导入”一个枚举类
- sql - 如何使用随机序列的 B 中的值更新填充 A 表中的空字段
- python - Python 在 exec() 之后找不到执行的函数