java - 无法使用来自 Jhipster 的给定路由连接到 H2 数据库

标签 java spring spring-boot jhipster h2

enter image description here

我有一个正在运行 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/

相关文章:

java - 如何使用 Hamcrest 进行匹配器收集?

spring - Java - Spring security、Shibboleth (apache) 和 onelogin

java - 将文件重命名为当前日期和时间 Spring Batch

spring - Thymeleaf 计数器变量不递增

java - 如何将 HTML 表格行拖放到另一个位置(在 Jsp 中)并将新位置(值)也保存在数据库(MySql)中?

java - 无法删除属于 @ManyToOne 关系的 JPA 实体

java - Spring Reactive 测试用例启动 Netty 服务器失败

spring - 使用特定的 application.properties 文件将 Spring Boot 应用程序部署到 Heroku

java - CPU模拟,随机化突发、等待和优先级

java - 使用 ajax get 发送数据时出现错误