CachingModelPropertiesProvider - NullPointerException after lazy load configuration
See original GitHub issueI’m facing the issue #1207 too, now with newer versions of springfox.
Springfox Versions:

Spring Boot Version: 2.1.2-RELEASE (using spring cloud parent Greenwich.RELEASE.
Spring Version: 5.1.4
I use undertow and everything works without setting all beans to lazy init.
After setting all spring beans to lazy load to improve the startup time, swagger is reporting error calculating properties for models. The cause is a NullPointerException because the objectMapper are null.
There is any kind of workaround this springfox issue? Or even a better way to set lazy initialization that works with swagger.
I have a BeanFactoryPostProcessor implemented that loop for all beans setting it to lazy init.
Thank you.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:25 (1 by maintainers)
Top Results From Across the Web
NullPointerException after lazy load configuration
After setting all spring beans to lazy load to improve the startup time, swagger is reporting error calculating properties for models. The cause ......
Read more >Making Spring Boot start lazy generates tons of warnings by ...
It actually works fine by cutting 1/3 of my applications starting time. However upon start my application log is filled with rows like:...
Read more >How to Fix and Avoid NullPointerException in Java - Rollbar
NullPointerException in Java occurs when a variable is accessed which is not pointing to any object and refers to nothing or null.
Read more >NullPointerException when browsing to Confluence
LazyReference $InitializationException: java.lang.NullPointerException at com.atlassian.util.concurrent.LazyReference.
Read more >Null pointer exception while running MUnit with Mule 4 ...
startIfNeeded(LifecycleUtils.java:164) at org.mule.runtime.config.internal.LazyMuleArtifactContext.lambda$null$5(LazyMuleArtifactContext.java:182) at ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@guisesterheim this exactly what I explained on my description: we can’t have lazy initialization if we want to use springfox.
This is exactly what we need to fix here. I want lazy initialization and springfox to work together.
Yeah with spring-boot really advertising lazy initialization as of 2.2 this issue really needs to be resolved.