我有一个正在运行 H2 数据库的 Java Spring 项目,在使用 mvnw
运行它并转到 http://localhost:8080/h2-console 后,上图是什么我明白了。
我团队中的其他人说这对他们来说工作得很好,我们在同一个代码库和 master 上。
我在 Chrome、Edge 和 Firefox 中尝试过,结果相同。我还仔细检查了 JavaScript 是否已打开并正常工作。
唯一记录到控制台的是当我将 spring security 日志记录设置为 DEBUG 时,这就是显示的内容:
----------------------------------------------------------
2020-10-19 16:14:18.376 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Request 'GET /h2-console/login.jsp' doesn't match 'OPTIONS /*
*'
2020-10-19 16:14:18.376 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/h2-console/login.jsp'; against
'/app/**/*.{js,html}'
2020-10-19 16:14:18.376 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/h2-console/login.jsp'; against
'/i18n/**'
2020-10-19 16:14:18.377 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/h2-console/login.jsp'; against
'/content/**'
2020-10-19 16:14:18.377 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/h2-console/login.jsp'; against
'/h2-console/**'
2020-10-19 16:14:18.377 DEBUG 13932 --- [ XNIO-1 task-1] o.s.security.web.FilterChainProxy : /h2-console/login.jsp has an empty filter list
2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Request 'GET /h2-console/stylesheet.css' doesn't match 'OPTIO
NS /**'
2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/h2-console/stylesheet.css'; aga
inst '/app/**/*.{js,html}'
2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/h2-console/stylesheet.css'; aga
inst '/i18n/**'
2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/h2-console/stylesheet.css'; aga
inst '/content/**'
2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/h2-console/stylesheet.css'; aga
inst '/h2-console/**'
2020-10-19 16:14:18.410 DEBUG 13932 --- [ XNIO-1 task-1] o.s.security.web.FilterChainProxy : /h2-console/stylesheet.css has an empty filter list
这可能是什么原因?
谢谢!
最佳答案
在设置 CSP header 的代码中添加不安全内联
关于java - 无法使用来自 Jhipster 的给定路由连接到 H2 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64436477/