【问题标题】:Cannot load driver class: org.postgresql.Driver Spring Boot Parent 2.3.0无法加载驱动程序类:org.postgresql.Driver Spring Boot Parent 2.3.0
【发布时间】:2020-09-17 16:50:44
【问题描述】:

这是我的 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.发布 2.3.0.RELEASE --> 2.3.0.发布 com.cab.booking 出租车预订 0.0.1-快照 出租车预订 出租车预订平台

<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 但没有运气。

这是错误日志截图。

【问题讨论】:

  • 删除驱动类名并使用正确的方言

标签: postgresql spring-boot spring-data-jpa


【解决方案1】:

这可能是没有意义的,但我遇到了同样的问题,并用这 2 行解决了:

spring.jpa.hibernate.ddl-auto=create
logging.level.org.hibernate.SQL=debug 

【讨论】:

    猜你喜欢
    • 2021-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    • 2018-01-31
    • 2020-11-06
    • 2014-10-14
    相关资源
    最近更新 更多