Springboot集成Swagger报错:Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
时隔一段时间,我再一次编写一个springboot项目来集成Swagger,结果发现一值报下面的错误,我百思不得其解,网上找的也搞不到事,最后才想起会不会是版本冲突。
长话短说:
原因: maven依赖冲突,导致空指针异常
springboot版本太高了,导致swagger 异常,是springboot2.6.0更新以后引起的问题。
解决办法: 将pom.xml的springboot的版本降低到2.6.0以下,我用的2.1.1.RELEASE版本的。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
报错:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-10-19 12:39:36.204 ERROR 8060 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
at org.springframewo