无法使用Jhipster从给定路由连接到H2数据库。

huangapple go评论111阅读模式
英文:

Cannot connect to H2 Database with given route from Jhipster

问题

我有一个Java Spring项目,正在运行H2数据库,在使用mvnw运行它后,访问 http://localhost:8080/h2-console,我看到了上面的图像。

我的团队中的其他成员说它对他们很好地工作,我们在相同的代码仓库上并且在主分支上。

我已经尝试过Chrome,Edge和Firefox,结果都是相同的。我还仔细检查了JavaScript是否已经启用并且正常工作。

控制台中唯一记录的内容是当我将spring security的日志级别设置为DEBUG时,会显示如下内容:

  1. ----------------------------------------------------------
  2. 2020-10-19 16:14:18.376 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 请求 'GET /h2-console/login.jsp' 不匹配 'OPTIONS /*
  3. *'
  4. 2020-10-19 16:14:18.376 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 检查请求匹配:'/h2-console/login.jsp'; 是否匹配
  5. '/app/**/*.{js,html}'
  6. 2020-10-19 16:14:18.376 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 检查请求匹配:'/h2-console/login.jsp'; 是否匹配
  7. '/i18n/**'
  8. 2020-10-19 16:14:18.377 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 检查请求匹配:'/h2-console/login.jsp'; 是否匹配
  9. '/content/**'
  10. 2020-10-19 16:14:18.377 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 检查请求匹配:'/h2-console/login.jsp'; 是否匹配
  11. '/h2-console/**'
  12. 2020-10-19 16:14:18.377 DEBUG 13932 --- [ XNIO-1 task-1] o.s.security.web.FilterChainProxy : /h2-console/login.jsp没有过滤器
  13. 2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 请求 'GET /h2-console/stylesheet.css' 不匹配
  14. 'OPTIONS /**'
  15. 2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 检查请求匹配:'/h2-console/stylesheet.css'; 是否匹配
  16. '/app/**/*.{js,html}'
  17. 2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 检查请求匹配:'/h2-console/stylesheet.css'; 是否匹配
  18. '/i18n/**'
  19. 2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 检查请求匹配:'/h2-console/stylesheet.css'; 是否匹配
  20. '/content/**'
  21. 2020-10-19 16:14:18.409 DEBUG 13932 --- [ XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher : 检查请求匹配:'/h2-console/stylesheet.css'; 是否匹配
  22. '/h2-console/**'
  23. 2020-10-19 16:14:18.410 DEBUG 13932 --- [ XNIO-1 task-1] o.s.security.web.FilterChainProxy : /h2-console/stylesheet.css没有过滤器

这可能是什么原因引起的?

谢谢!

英文:

无法使用Jhipster从给定路由连接到H2数据库。

I have a Java Spring project that is running the H2 database, and after running it with mvnw, and going to http://localhost:8080/h2-console, the above image is what I see.

Other people on my team said it works just fine for them, and we are on the same code repo and on master.

I have tried in Chrome, Edge, and Firefox with the same results. I have also double checked that JavaScript is turned on and working.

The only thing logged to the console is when I have spring security logging set to DEBUG and then this is what is shown:

  1. ----------------------------------------------------------
  2. 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 /*
  3. *'
  4. 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
  5. '/app/**/*.{js,html}'
  6. 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
  7. '/i18n/**'
  8. 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
  9. '/content/**'
  10. 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
  11. '/h2-console/**'
  12. 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
  13. 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
  14. NS /**'
  15. 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
  16. inst '/app/**/*.{js,html}'
  17. 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
  18. inst '/i18n/**'
  19. 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
  20. inst '/content/**'
  21. 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
  22. inst '/h2-console/**'
  23. 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

What could be the cause of this?

Thanks!

答案1

得分: 3

将不安全的内联代码添加到您设置CSP标头的代码中。

英文:

add unsafe inline to the code, where you set CSP headers

答案2

得分: 0

"看起来你的 Chrome 浏览器中没有启用 Java 脚本,你可以尝试以下步骤:\n\nhttps://www.whatismybrowser.com/guides/how-to-enable-javascript/chrome"

英文:

Looks like Java script is not enabled in your chrome browser, could you please try the below details?

https://www.whatismybrowser.com/guides/how-to-enable-javascript/chrome

huangapple
  • 本文由 发表于 2020年10月20日 07:39:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/64436477.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定