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
- Annotate the class or declare a @Bean
- Move it under the @SpringBootApplication package
- Add @Primary or @Qualifier
Detailed fix by platform
Java
- Run with
--debugto print the auto-configuration report
How to diagnose
- Bean — Which type is missing?
- 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026