question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CachingModelPropertiesProvider - NullPointerException after lazy load configuration

See original GitHub issue

I’m facing the issue #1207 too, now with newer versions of springfox.

Springfox Versions: image

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:open
  • Created 4 years ago
  • Reactions:12
  • Comments:25 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
lucasoarescommented, Oct 19, 2020

@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.

4reactions
ledjoncommented, Oct 17, 2019

Yeah with spring-boot really advertising lazy initialization as of 2.2 this issue really needs to be resolved.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found