Нет подходящего bean-компонента доступного типа: ожидается как минимум один bean-компонент, который квалифицируется как JAVA

Программисты JAVA общаются здесь
Anonymous
Нет подходящего bean-компонента доступного типа: ожидается как минимум один bean-компонент, который квалифицируется как

Сообщение Anonymous »

Невозможно запустить сервер после обновления Spring boot3.
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.sample.fa.repository.NewsRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

Description:
Field newsRepository in com.sample.fa.service.NewsService required a bean of type 'com.sample.fa.repository.NewsRepository' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)

// код
@Repository
public interface NewsRepository extends JpaRepository {

Optional findById(Long id);

}

Вернуться в «JAVA»