Skip to content
Advertisement

h2 console not being found in browser while running springboot application

Im trying to get the h2 console in my browser while my my Springboot application.

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sun Apr 24 00:44:22 IST 2022 There was an unexpected error (type=Not Found, status=404).

This is my application.properties file

spring.h2.console.enable=true
spring.h2.console.path=/h2

spring.datasource.url=jdbc:h2:mem:memDb;DB_CLOSE_DELAY=-1
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password

I have tried both

http://localhost:8080/h2/

and

http://localhost:8080/h2-console/

This is the log I get every time I enter either of those 2 URLs in the browser

2022-04-24 00:53:27.718  INFO 6060 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-04-24 00:53:27.719  INFO 6060 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-04-24 00:53:27.720  INFO 6060 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms

Also in my problems terminal of my project ide It says this for each line in my application.properties

Unused property:1
Unused property:2
Unused property:4
Unused property:5
Unused property:6
Unused property:7

Advertisement

Answer

You are missing “d” – enabled

spring.h2.console.enabled=true
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement