• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


25 Feb, 2025

Updated at 21 Mar, 2025

Check bean dependencies at runtime

In my Spring Boot application I have declared a custom scope for some of my beans. I would like to avoid injecting these beans directly into Singleton beans and instead use a Provider to get instances to these beans.

Is there a way to check this at application start and throw an exception when a Singleton bean uses one of the custom scope beans directly?

Would be great if someone could point me in the right direction.