集成swagger出现下面的错误
org.springframework.context.ApplicationContextException:
Failed to start bean 'documentationPluginsBootstrapper';
nested exception is java.lang.NullPointerException
对应的依赖版本是3.0.0
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
解决办法
在启动类上加上@EnableWebMvc注解
就可以启动
访问界面为http://localhost:8080/swagger-ui/index.html
在集成Swagger3.0.0时遇到ApplicationContextException,原因是一个NullPointerException。为了解决这个问题,可以在启动类上添加@EnableWebMvc注解,这将允许应用成功启动并能访问SwaggerUI界面,URL为http://localhost:8080/swagger-ui/index.html。
1103

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



