NoSuchBeanDefinitionException: No qualifying bean of type 'X' available
Spring has no bean of the requested type, so it cannot inject it.
Exact message you may see
No qualifying bean of type availableexpected at least 1 bean which qualifies as autowire candidate Meaning
The class is not annotated, not in a scanned package, excluded by a profile or condition, or the starter that defines it is missing.
Common causes
- Missing
@Component/@Service/@Bean - Class outside the component-scan base package
- Wrong profile or
@ConditionalOn…false - Auto-configuration missing (starter not on classpath)
⚡ Quick fix
- Annotate the class and place it under the main application package
- Add
@ComponentScanor@Import - Add the required starter dependency
Detailed fix by platform
Spring Boot
- Put the
@SpringBootApplicationclass in the root package so sub-packages are scanned
How to diagnose
- Annotation — Present?
- Package — Scanned?
- Profile — Active?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Most viewed in Java
Other ways to find it
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Did this fix work for you?
Report a correction or suggest an improvement
Last updated 2 Dec 2026