java - Spring Cloud 配置服务器发送 Spring Security 登录表单而不是 logback.xml
问题描述
我正在使用 spring 云配置服务器来存储logback.xml
配置。这是我使用的微服务(即 spring 云配置客户端)bootstrap.properties
文件:
server.port=5555
spring.application.name=test-ms
spring.profiles.active=development
spring.cloud.config.uri=http://localhost:8888
spring.cloud.config.username=root
spring.cloud.config.password=123123
logging.config=http://localhost:8888/test-ms/development/master/logback.xml
这一直很好,直到我在我的 spring 云配置服务器上打开 spring security。之后它发送弹簧安全登录表单而不是logback.xml
所以我得到一个异常:
Logging system failed to initialize using configuration from 'http://localhost:8888/test-ms/development/master/logback.xml'
java.lang.IllegalStateException: Could not initialize Logback logging from http://localhost:8888/test-ms/development/master/logback.xml
...
Caused by: org.xml.sax.SAXParseException; systemId: http://localhost:8888/test-ms/development/master/logback.xml; lineNumber: 11; columnNumber: 5; The element type "link" must be terminated by the matching end-tag "</link>".
因为正如我所说,它正在获取 spring 安全登录页面而不是logback.xml
. 但我需要在我的 spring 云配置服务器上进行身份验证。我尝试将用户名和密码放入 url:logging.config=http://user:passwordlocalhost:8888/test-ms/development/master/logback.xml
但它没有帮助。如何将我的 Spring Cloud 配置客户端指向 Spring Cloud 配置服务器上的 xml?
解决方案
推荐阅读
- docker - 在 Dockerfile 中下载数据并批量使用
- swift - 如何将 CMTime 存储在 UserDefaults 中然后解析它?
- c++ - 对范围和堆内存寿命感到困惑
- wpf - wpf 动态用户安全
- php - foreach 中的变量命名
- php - 如何将自定义价格等自定义选项传递给 WooCommerce 购物车
- ruby-on-rails - 来自自己的控制器方法的嵌套资源 - 或创建全新的控制器?
- javascript - 使用 $.getJSON 将 $_GET 中的城市替换为经纬度
- google-apps-script - 我可以制作与域用户和协作者共享的 GSuite 插件吗
- java - 我是否需要担心使用 ENUM 的默认操作?