报错提示
org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.21.jar:5.3.21]
at org.springframework.context.support.DefaultLifecycleProcessor.access 200 ( D e f a u l t L i f e c y c l e P r o c e s s o r . j a v a : 54 ) [ s p r i n g − c o n t e x t − 5.3.21. j a r : 5.3.21 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . D e f a u l t L i f e c y c l e P r o c e s s o r 200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.21.jar:5.3.21] at org.springframework.context.support.DefaultLifecycleProcessor 200(DefaultLifecycleProcessor.java:54) [spring−context−5.3.21.jar:5.3.21]atorg.springframework.context.support.DefaultLifecycleProcessorLifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.21.jar:5.3.21]
at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_191]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.21.jar:5.3.21]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.21.jar:5.3.21]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.21.jar:5.3.21]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.21.jar:5.3.21]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.9.jar:2.6.9]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) [spring-boot-2.6.9.jar:2.6.9]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) [spring-boot-2.6.9.jar:2.6.9]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-2.6.9.jar:2.6.9]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) [spring-boot-2.6.9.jar:2.6.9]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.6.9.jar:2.6.9]
at com.hou.weixing3_springboot.Weixing3SpringbootApplication.main(Weixing3SpringbootApplication.java:14) [classes/:na]
Caused by: java.lang.NullPointerException: null
at springfox.documentation.spring.web.WebMvcPatternsRequestConditionWrapper.getPatterns(WebMvcPatternsRequestConditionWrapper.java:56) ~[springfox-spring-webmvc-3.0.0.jar:3.0.0]
at springfox.documentation.RequestHandler.sortedPaths(RequestHandler.java:113) ~[springfox-core-3.0.0.jar:3.0.0]
at springfox.documentation.spi.service.contexts.Orderings.lambda$byPatternsCondition 3 ( O r d e r i n g s . j a v a : 89 ) [ s p r i n g f o x − s p i − 3.0.0. j a r : 3.0.0 ] a t j a v a . u t i l . C o m p a r a t o r . l a m b d a 3(Orderings.java:89) ~[springfox-spi-3.0.0.jar:3.0.0] at java.util.Comparator.lambda 3(Orderings.java:89) [springfox−spi−3.0.0.jar:3.0.0]atjava.util.Comparator.lambdacomparing$77a9974f 1 ( C o m p a r a t o r . j a v a : 469 ) [ n a : 1.8. 0 1 91 ] a t j a v a . u t i l . T i m S o r t . c o u n t R u n A n d M a k e A s c e n d i n g ( T i m S o r t . j a v a : 355 ) [ n a : 1.8. 0 1 91 ] a t j a v a . u t i l . T i m S o r t . s o r t ( T i m S o r t . j a v a : 220 ) [ n a : 1.8. 0 1 91 ] a t j a v a . u t i l . A r r a y s . s o r t ( A r r a y s . j a v a : 1512 ) [ n a : 1.8. 0 1 91 ] a t j a v a . u t i l . A r r a y L i s t . s o r t ( A r r a y L i s t . j a v a : 1462 ) [ n a : 1.8. 0 1 91 ] a t j a v a . u t i l . s t r e a m . S o r t e d O p s 1(Comparator.java:469) ~[na:1.8.0_191] at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) ~[na:1.8.0_191] at java.util.TimSort.sort(TimSort.java:220) ~[na:1.8.0_191] at java.util.Arrays.sort(Arrays.java:1512) ~[na:1.8.0_191] at java.util.ArrayList.sort(ArrayList.java:1462) ~[na:1.8.0_191] at java.util.stream.SortedOps 1(Comparator.java:469) [na:1.8.0191]atjava.util.TimSort.countRunAndMakeAscending(TimSort.java:355) [na:1.8.0191]atjava.util.TimSort.sort(TimSort.java:220) [na:1.8.0191]atjava.util.Arrays.sort(Arrays.java:1512) [na:1.8.0191]atjava.util.ArrayList.sort(ArrayList.java:1462) [na:1.8.0191]atjava.util.stream.SortedOpsRefSortingSink.end(SortedOps.java:387) ~[na:1.8.0_191]
at java.util.stream.Sink C h a i n e d R e f e r e n c e . e n d ( S i n k . j a v a : 258 ) [ n a : 1.8. 0 1 91 ] a t j a v a . u t i l . s t r e a m . S i n k ChainedReference.end(Sink.java:258) ~[na:1.8.0_191] at java.util.stream.Sink ChainedReference.end(Sink.java:258) [na:1.8.0191]atjava.util.stream.SinkChainedReference.end(Sink.java:258) ~[na:1.8.0_191]
at java.util.stream.Sink C h a i n e d R e f e r e n c e . e n d ( S i n k . j a v a : 258 ) [ n a : 1.8. 0 1 91 ] a t j a v a . u t i l . s t r e a m . S i n k ChainedReference.end(Sink.java:258) ~[na:1.8.0_191] at java.util.stream.Sink ChainedReference.end(Sink.java:258) [na:1.8.0191]atjava.util.stream.SinkChainedReference.end(Sink.java:258) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[na:1.8.0_191]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_191]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[na:1.8.0_191]
at springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider.requestHandlers(WebMvcRequestHandlerProvider.java:81) ~[springfox-spring-webmvc-3.0.0.jar:3.0.0]
at java.util.stream.ReferencePipeline$3 1. a c c e p t ( R e f e r e n c e P i p e l i n e . j a v a : 193 ) [ n a : 1.8. 0 1 91 ] a t j a v a . u t i l . A r r a y L i s t 1.accept(ReferencePipeline.java:193) ~[na:1.8.0_191] at java.util.ArrayList 1.accept(ReferencePipeline.java:193) [na:1.8.0191]atjava.util.ArrayListArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[na:1.8.0_191]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_191]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[na:1.8.0_191]
at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.withDefaults(AbstractDocumentationPluginsBootstrapper.java:107) ~[springfox-spring-web-3.0.0.jar:3.0.0]
at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.buildContext(AbstractDocumentationPluginsBootstrapper.java:91) ~[springfox-spring-web-3.0.0.jar:3.0.0]
at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.bootstrapDocumentationPlugins(AbstractDocumentationPluginsBootstrapper.java:82) ~[springfox-spring-web-3.0.0.jar:3.0.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:100) ~[springfox-spring-web-3.0.0.jar:3.0.0]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.21.jar:5.3.21]
… 14 common frames omitted
问题所在:swagger和springboot版本不匹配的问题
我现在用的是2.6.9
需要修改springboot版本为2.5.9