0

In our enterprise framework, we have a list of Spring beans(@Bean) defined in a config(@Configuration) class. For some reason, we want to lazy load all the Spring beans defined in that config class but we don't have access to enterprise framework source code to add @Lazy to the config class.

Can someone please tell, how we can lazy load the beans defined in the framework in our application code?

whoami
  • 1,517
  • 1
  • 21
  • 29

1 Answers1

0

Try to use @ComponentScan like this:

   @ComponentScan(basePackageClasses = {ExampleController.class, ExampleModel.class, ExmapleView.class}, lazyInit = true)

For more info go to link

Abdelhak
  • 8,299
  • 4
  • 22
  • 36