WARN 404 --- [nio-8080-exec-1] o.s.web.servlet.PageNotFound

WARN 404 --- [nio-8080-exec-1] o.s.web.servlet.PageNotFound             : No mapping for GET /swagger-ui.html   Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
给他继承  WebMvcConfigurationSupport  
并重写  ddResourceHandlers方法




@Configuration
@EnableSwagger2
public class SwaggerConfig extends WebMvcConfigurationSupport {

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("doc.html")
.addResourceLocations("classpath:/META-INF/resources/");

registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}
posted @ 2022-10-13 21:13  不如赐场梦给我  阅读(1595)  评论(0编辑  收藏  举报