spring doesnt see my repo class as a bean

hey guys. so i have my service class:
@Service
public class ItemService {
    private ItemRepository itemRepository;
    public ItemService(ItemRepository itemRepository) {
        this.itemRepository = itemRepository;
    }
    public String getItemsByDistanceAndSeason(double distance,String season) {
        //call repo, etc
        return "Get items";
    }
}
and a repo class:
@Repository
public interface ItemRepository extends CrudRepository<Item,Long> {
    public List<Item> getAllByDistanceAndSeason(String season);
}

but when i start my app, i get an error:
Description:

Parameter 0 of constructor in lt.brilingas.tieto.service.ItemService required a bean of type 'lt.brilingas.tieto.repository.ItemRepository' that could not be found.


Action:

Consider defining a bean of type 'lt.brilingas.tieto.repository.ItemRepository' in your configuration.

and the thing is that i have all the needed annotations. can smb take a look? thx
Was this page helpful?