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

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

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时,会显示如下内容:

----------------------------------------------------------
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 /*
*'
2020-10-19 16:14:18.376 DEBUG 13932 --- [  XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher  : 检查请求匹配:'/h2-console/login.jsp'; 是否匹配
'/app/**/*.{js,html}'
2020-10-19 16:14:18.376 DEBUG 13932 --- [  XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher  : 检查请求匹配:'/h2-console/login.jsp'; 是否匹配
'/i18n/**'
2020-10-19 16:14:18.377 DEBUG 13932 --- [  XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher  : 检查请求匹配:'/h2-console/login.jsp'; 是否匹配
'/content/**'
2020-10-19 16:14:18.377 DEBUG 13932 --- [  XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher  : 检查请求匹配:'/h2-console/login.jsp'; 是否匹配
'/h2-console/**'
2020-10-19 16:14:18.377 DEBUG 13932 --- [  XNIO-1 task-1] o.s.security.web.FilterChainProxy        : /h2-console/login.jsp没有过滤器
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' 不匹配
'OPTIONS /**'
2020-10-19 16:14:18.409 DEBUG 13932 --- [  XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher  : 检查请求匹配:'/h2-console/stylesheet.css'; 是否匹配
'/app/**/*.{js,html}'
2020-10-19 16:14:18.409 DEBUG 13932 --- [  XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher  : 检查请求匹配:'/h2-console/stylesheet.css'; 是否匹配
'/i18n/**'
2020-10-19 16:14:18.409 DEBUG 13932 --- [  XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher  : 检查请求匹配:'/h2-console/stylesheet.css'; 是否匹配
'/content/**'
2020-10-19 16:14:18.409 DEBUG 13932 --- [  XNIO-1 task-1] o.s.s.w.u.matcher.AntPathRequestMatcher  : 检查请求匹配:'/h2-console/stylesheet.css'; 是否匹配
'/h2-console/**'
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:

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

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:

确定