前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Spring Boot Actuator监控页面报错解决

Spring Boot Actuator监控页面报错解决

作者头像
猿天地
发布2018-04-03 12:47:41
1.2K0
发布2018-04-03 12:47:41
举报
文章被收录于专栏:猿天地猿天地

今天在访问Spring Boot Actuator监控页面的时候报错了,之前都没遇到这种情况,大概的意思就是无权限访问

代码语言:javascript
复制
<html>
  <body>
   <h1>Whitelabel Error Page</h1>
   <p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>
   <div id='created'>Tue Nov 07 14:14:32 CST 2017</div>
   <div>There was an unexpected error (type=Unauthorized, status=401).</div>
   <div>Full authentication is required to access this resource.</div>
  </body>
</html>

然后我看了下控制台,找到了有用的信息

说访问端点信息需要认证身份,请将management.security.enabled设置为false来关闭验证功能

代码语言:javascript
复制
2017-11-07 14:13:19.742  INFO 11232 --- [nio-2101-exec-1] s.b.a.e.m.MvcEndpointSecurityInterceptor : Full authentication is required to access actuator endpoints. Consider adding Spring Security or set 'management.security.enabled' to false.

解决方案当然就是在属性文件中加上management.security.enabled=false

那么为什么会出现这种情况呢,我看了下源码,之前我用的spring boot是1.4.2版本的,源码里面是没有MvcEndpointSecurityInterceptor 这个拦截器的

目前用的spring boot是1.5.4,应该是新版本加进来的,这就是为什么之前没有遇到过这个问题

关于actuator的使用可以查询我的这篇文章:http://cxytiandi.com/blog/detail/8123

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2017-11-14,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 猿天地 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档