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

**Code:** `UnsatisfiedDependencyException` · **Category:** Java · **Seen on:** Java

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/java/spring-unsatisfieddependencyexception)
