postgresql - 无法加载驱动程序类:org.postgresql.Driver Spring Boot Parent 2.3.0
问题描述
这是我的 pom.xml
https://maven.apache.org/xsd/maven-4.0.0.xsd">4.0.0 org.springframework.boot spring-boot-starter-parent 2.2.4.RELEASE</version> 2.3.0.RELEASE </version> --> 2.3.0.RELEASE com.cab.booking cab-booking 0.0.1-SNAPSHOT cab-booking 出租车预订平台
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
这是我的 application.properties 文件
尝试使用 postgresql 版本 42.2.12 但没有运气。
这是错误日志屏幕截图。
解决方案
May be this doesn't make sense but I had same problem and it was fixed with this 2 lines:
spring.jpa.hibernate.ddl-auto=create
logging.level.org.hibernate.SQL=debug
推荐阅读
- javascript - 在 NodeJS 中将数据插入到 oracle 数据库表中
- ios - 在模拟器上使用 FaceID 和 TouchID 测试身份验证失败
- c# - Azure 函数 - 获取配置推荐做法
- mysql - 在 mac 上安装 asp.net mvc web 应用程序,但出现这些错误
- excel - 将公共变量转移到其他工作表的问题
- python - Fail to upload multiple objects with boto3 to google storage
- django - /play/api/5/play/ 处的 Django AssertionError `request` 参数必须是 `django.http.HttpRequest` 的实例,而不是 `myApp.views.TrackPlayAPIToggle`
- php - Netbeans:如何上传更改的文件?
- c# - UWP VisualTreeHelper 参数错误参考
- javascript - 如何防止div下滑?