Unable to start server, After updating 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)
// code
@Repository
public interface NewsRepository extends JpaRepository<News, Long> {
Optional<News> findById(Long id);
}