Closed
Description
Please take the time to search the repository, if your question has already been asked or answered.
- What version of the library are you using? Is it the latest version? The latest released version is [ ![Download]
We are using 3.0.0
bug report
We are using spring boot version is 2.5.0-SNAPSHOT, https://repo.spring.io/snapshot as plugin repository
It was OK a few days ago, This problem occurred when I recompiled today
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.6.jar:5.3.6]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.6.jar:5.3.6]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.6.jar:5.3.6]
at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_77]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.6.jar:5.3.6]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.6.jar:5.3.6]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.6.jar:5.3.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.6.jar:5.3.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.0-20210413.204210-414.jar:2.5.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:772) [spring-boot-2.5.0-20210413.204210-414.jar:2.5.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:441) [spring-boot-2.5.0-20210413.204210-414.jar:2.5.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:339) [spring-boot-2.5.0-20210413.204210-414.jar:2.5.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350) [spring-boot-2.5.0-20210413.204210-414.jar:2.5.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1339) [spring-boot-2.5.0-20210413.204210-414.jar:2.5.0-SNAPSHOT]
at com.example.demo.DemoApplication.main(DemoApplication.java:12) [classes/:na]
Caused by: java.lang.NullPointerException: null
Activity
jasondayee commentedon Apr 14, 2021
I have changed our Spring Boot project version from 2.5.0-SNAPSHOT to 2.5.0-M3
It is works now.
I think the reason is that Spring Boot version 2.5.0-SNAPSHOT is unstable
stale commentedon Jul 14, 2021
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
stale commentedon Jul 28, 2021
This issue has been automatically closed because it has not had recent activity. Please re-open a new issue if this is still an issue.
mikmela commentedon Oct 4, 2021
Got the same exception with SpringBoot 2.5.4.
we have a very simple spring data repository interface that extends CrudRepository
cpesch commentedon Nov 22, 2021
Strange, for me it works with Spring 2.5.5 but not with 2.6.0
Found a hint at https://stackoverflow.com/questions/70036953/springboot-2-6-0-spring-fox-3-failed-to-start-bean-documentationpluginsboot to set spring.mvc.pathmatch.matching-strategy to ant-path-matcher but the problem persists:
Caused by: 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) at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ... 69 more Caused by: java.lang.NullPointerException at springfox.documentation.spring.web.WebMvcPatternsRequestConditionWrapper.getPatterns(WebMvcPatternsRequestConditionWrapper.java:56) at springfox.documentation.RequestHandler.sortedPaths(RequestHandler.java:113) at springfox.documentation.spi.service.contexts.Orderings.lambda$byPatternsCondition$3(Orderings.java:89) at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469) at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.base/java.util.TimSort.sort(TimSort.java:220) at java.base/java.util.Arrays.sort(Arrays.java:1515) at java.base/java.util.ArrayList.sort(ArrayList.java:1750) at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:392) at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) at springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider.requestHandlers(WebMvcRequestHandlerProvider.java:81) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.withDefaults(AbstractDocumentationPluginsBootstrapper.java:107) at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.buildContext(AbstractDocumentationPluginsBootstrapper.java:91) at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.bootstrapDocumentationPlugins(AbstractDocumentationPluginsBootstrapper.java:82) at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:100) at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178)
ice09 commentedon Nov 23, 2021
Yes, with Spring Boot 2.6.0 it does not work, with 2.5.6 or 2.5.7 it does.
alexandreJavaDeveloper commentedon Nov 25, 2021
Any news?
I have the same issue with SpringBoot 2.6.0 and SpringFox 3.0.0.
I tried this link https://stackoverflow.com/questions/70036953/springboot-2-6-0-spring-fox-3-failed-to-start-bean-documentationpluginsboot but it does not work neither.
jiwen624 commentedon Nov 26, 2021
Just hit the same issue with Spring Boot 2.6.0. Switched back to 2.5.7 and set the following dependencies:
alexandreJavaDeveloper commentedon Nov 26, 2021
No sure back to 2.5.7 is the best option, at least not in my project. We need to find a solution in 2.6.0 version.
jloisel commentedon Nov 29, 2021
Same issue here with Spring boot
2.6.1
.alexandreJavaDeveloper commentedon Nov 29, 2021
Have a look at #3462
It worked for me in Spring Boot 2.6.0. So it should work in 2.6.1 too.
19 remaining items
vanchondo commentedon Jul 25, 2022
Setting spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER in the properties file worked for me
https://webfuse.in/blogs/org-springframework-context-applicationcontextexception-failed-to-start-bean-documentationpluginsbootstrapper-nested-exception-is-java-lang-nullpointerexception/
[+] Downgraded Spring Boot due to Springfox springfox/springfox#3791 …
Thinkenterprise commentedon Aug 16, 2022
I'm working with Spring Boot 2.7.2 and have the same problem. The problem is the switch to the Path Pattern Parser in Spring Boot 2.6 . SpringFox doesn't seem to take this into account yet. Therefore the configuration as mentioned by @vedannt is correct, which switches back to Ant Matcher.
du-mingfu commentedon Aug 19, 2022
Spring Boot 2.7.2 with springfox-boot-starter:3.0.0 it worked.
keemsisi commentedon Dec 18, 2022
If you are using Intelij: Invalidate Cache/ Restart your IDEA
mintonzhang commentedon Dec 22, 2022
Replace the original automatic injection, and remove the processor that cannot work before this
ccoderJava commentedon Feb 6, 2023
current stack exception information :
Add the following Spring beans manually。
SeyfCHERNI commentedon Apr 13, 2023
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER
solved my issue Now
girish-vm commentedon Jun 7, 2023
Hi Team,
I am currently using spring boot 2.7.12 version
But facing the same issue as above .
I used ANT_PATH too but doesn't work
Please help .
guruteja99 commentedon Jun 15, 2023
Hi @girish-vm
Even I am in the same situation, please help me if you find the solution.
No workarounds fixed the issue.
After adding the spring beans manually I am getting a white label error for swagger-ui page.
lukaszkowalik commentedon Jul 4, 2023
I got same issue and this hint helped me
natnael-bedru commentedon Jul 12, 2023
I am running on
Java 11.0.8
and my project folder is based onSpringboot 2.7.13
pom.xml
SwaggerConfig.java
DemoApplication.java
--Where the Springboot starts--You can remove this if you have this set in the
application.properties
file.It works without it.
ayuayue commentedon Aug 1, 2023
Disable spring-boot-starter-actuator to try, the two conflict!
4nt01ne commentedon Sep 27, 2023
Thanks @natnael-bedru
It worked for me with java 11.0.17, Springboot 2.7.16 and
adlo1001 commentedon Oct 31, 2023
The same problem here but It worked after adding this line in appliction.properties
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER