Error creating bean with name 'documentationPluginsBootstrapper'及访问swagger2出现404


Error creating bean with name 'documentationPluginsBootstrapper是因为没有在配置类加@EnableWebMvC注解
@Configuration
@EnableSwagger2
还有这两个注解



访问swagger2出现404需要写如下配置类才能够访问

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
}
}

麻了,跟着做谷粒学院项目,视频都没提到这些都能运行,搜了很久什么版本原因搞的心态差点蹦了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM