黑马头条Day1第15集访问Swagger显示:
Unable to infer base url. This is common when using dynamic servlet registration or when the API is …。
解决方法:
1.检查你的spring.factories中复制的地址com.heima.common.exception.ExceptionCatch与com.heima.common.swagger.SwaggerConfiguration之间是否有,\如果没有请加上。
2.在UserApplication类下添加如下注解
@ComponentScan(basePackages = "com.heima")
本文讲述了在使用Swagger时遇到Unabletoinferbaseurl问题的常见原因,即动态servlet注册或API配置不完整。解决方法包括检查Spring.factories文件中的路径分隔符和在UserApplication类上添加@ComponentScan注解。
866

被折叠的 条评论
为什么被折叠?



