0

I've seen variations of this subject multiple times around, but the answers never solved my case: I've been adding the H2 console to my WebFlux application (Spring Boot 2.6.3) and could connect to it; but couldn't see any of my tables in my JDBC schema. Thing is... My controller is working fine and I can retrieve from my endpoint the expected structure and data I did setup into shema.sql et data.sql

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-r2dbc</artifactId>
    </dependency>
    <dependency>
        <groupId>io.r2dbc</groupId>
        <artifactId>r2dbc-h2</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>me.yaman.can</groupId>
        <artifactId>spring-boot-webflux-h2-console</artifactId>
        <version>0.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-webflux</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>

These are my properties : I'm connecting to localhost:8080/h2-console and am being redirected to localhost:8081/ all right

spring.datasource.url=jdbc:h2:mem:pocdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.username=sa
spring.datasource.password=foobar
spring.datasource.driverClassName=org.h2.Driver
spring.h2.console.enabled=true
spring.h2.console.port=8081
spring.h2.console.path=/h2-console

As I said, the connection to the console is OK, with my "pocdb" schema declared in the login URL; but I can't see any custom tables in here :-(

I also tried with and without the db url parameters but nothing changes. IF somebody has any clue about what I'm doing wrong, I'd be relieved to here it. Thx

Thomas Escolan
  • 1,298
  • 1
  • 10
  • 28
  • Does this answer your question? [H2 db not accessible at localhost:8080/h2-console when using webflux](https://stackoverflow.com/questions/52949088/h2-db-not-accessible-at-localhost8080-h2-console-when-using-webflux) – K.Nicholas Feb 07 '22 at 15:58
  • Sorry @K.Nicholas but no. I made clear that the console is up and running though; my issue is with no custom table from my schema shown in the UI – Thomas Escolan Feb 07 '22 at 16:54

0 Answers0