小编Nic*_*las的帖子

升级到 Spring Boot 3 Swagger UI 后无法访问

我有一个 Spring Boot 2.7.6 应用程序,Spring Security 5.7.5 运行没有问题:身份验证有效,我根据角色浏览不同的页面,Swagger UI 可用等。我没有针对您的不推荐使用的警告信息。

\n

我迁移到 Spring Boot 3.0.0,因此迁移到 Spring Security 6.0.0。我按照迁移指南进行操作,服务器启动没有错误。但我的网址不再有效。我的状态是 401。

\n

问题#1:GET http://localhost:8080/swagger-ui/index.html导致客户端出现 401 错误。

\n

在日志中我有一个 404:

\n
DEBUG o.s.web.servlet.handler.SimpleUrlHandlerMapping    : Mapped to ResourceHttpRequestHandler [classpath [static/]]\nDEBUG o.s.web.servlet.handler.SimpleUrlHandlerMapping    : Mapped to ResourceHttpRequestHandler [classpath [static/]]\nDEBUG o.s.web.servlet.handler.SimpleUrlHandlerMapping    : Mapped to ResourceHttpRequestHandler [classpath [static/]]\nDEBUG o.s.web.servlet.handler.SimpleUrlHandlerMapping    : Mapped to ResourceHttpRequestHandler [classpath [static/]]\nDEBUG org.springframework.web.servlet.DispatcherServlet  : GET "/swagger-ui/index.html", parameters={}\nDEBUG o.s.web.servlet.handler.SimpleUrlHandlerMapping    : Mapped to ResourceHttpRequestHandler [classpath [static/]]\nDEBUG o.s.w.servlet.resource.ResourceHttpRequestHandler  : Resource not found\nDEBUG org.springframework.web.servlet.DispatcherServlet  : Completed 404 …
Run Code Online (Sandbox Code Playgroud)

java migration spring-security spring-boot springdoc-ui

3
推荐指数
1
解决办法
2587
查看次数