UnsatisfiedDependencyException is a runtime exception that is thrown when the Spring framework is unable to resolve a dependency for a bean.
You can use environment variables in your application.properties file by using the spring.profiles.active property.
In Spring, the @Component annotation is used to mark a Java class as a candidate for component scanning. The @Repository annotation is a specialization of @Component for use in the persistence layer.
There are several reasons why an @Autowired field in a Spring bean might be null: