UnsatisfiedDependencyException ☕ Java

UnsatisfiedDependencyException / NoSuchBeanDefinitionException: No qualifying bean of type 'X' available

Spring couldn’t find (or choose) a bean to inject.

Seen on: Java

Meaning

The class isn’t a Spring bean (missing @Service/@Component), it’s outside the component-scan package, an auto-configuration didn’t activate, or several beans match without a qualifier.

Common causes

  • Missing @Component/@Service/@Repository
  • Class outside the main application package (component scan)
  • Multiple candidates without @Primary/@Qualifier
  • Conditional auto-config not active (missing property/dependency)

⚡ Quick fix

  1. Annotate the class or declare a @Bean
  2. Move it under the @SpringBootApplication package
  3. Add @Primary or @Qualifier

Detailed fix by platform

Java

  1. Run with --debug to print the auto-configuration report

How to diagnose

  1. Bean — Which type is missing?
  2. Scan — Is it in a scanned package?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.