小编rit*_*ata的帖子

当我在 springboot 项目中点击 http://localhost:8080/h2-console url 时,出现 Whitelabel 错误页面错误

this is my application.properties file in src/main/resource


spring.datasource.platform=h2
spring.h2.console.enabled=true  
spring.datasource.url=jdbc:h2:mem:testdb
Run Code Online (Sandbox Code Playgroud)

我在 pom.xml 中添加了 h2 依赖项

<dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

另一种是Jpa依赖和Web依赖

<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>
Run Code Online (Sandbox Code Playgroud)

整个项目在邮递员中运行良好,但当我在网络浏览器中点击 url 时不起作用

java h2 spring-boot postman

1
推荐指数
1
解决办法
3631
查看次数

标签 统计

h2 ×1

java ×1

postman ×1

spring-boot ×1