运行 springboot 应用程序在浏览器中找不到 h2 控制台

h2 console not being found in browser while running springboot application

我正在尝试在我的 Springboot 应用程序中获取浏览器中的 h2 控制台。

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).

这是我的 application.properties 文件

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

我都试过了

http://localhost:8080/h2/

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

这是我每次在浏览器中输入这 2 个 URL 中的任何一个时得到的日志

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

也在我项目的问题终端中ide 它对我的 application.properties

中的每一行都这样说
Unused property:1
Unused property:2
Unused property:4
Unused property:5
Unused property:6
Unused property:7

您缺少“d”- 已启用

spring.h2.console.enabled=true