Параметр 0 конструктора требовал bean-компонента типа, который не удалось найти.JAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Параметр 0 конструктора требовал bean-компонента типа, который не удалось найти.

Сообщение Anonymous »

У меня возникла проблема с запуском приложения весенней загрузки в производственной среде. В локальной среде все по-прежнему работает нормально.
Это моя ошибка

Код: Выделить всё

Description:

Parameter 0 of constructor in com.tkg.product.service.impl.LocationService required a bean of type 'com.tkg.product.repository.CountryRepositoryInterface' that could not be found.

Action:

Consider defining a bean of type 'com.tkg.product.repository.CountryRepositoryInterface' in your configuration.
Это мой код:
LocationService

Код: Выделить всё

package com.tkg.product.service.impl;

import com.tkg.product.entity.Country;
import com.tkg.product.entity.Destination;
import com.tkg.product.repository.CountryRepositoryInterface;
import com.tkg.product.repository.DestinationRepositoryInterface;
import com.tkg.product.service.LocationServiceInterface;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class LocationService implements LocationServiceInterface {

private final CountryRepositoryInterface countryRepository;

private final DestinationRepositoryInterface destinationRepository;

@Override
public List countries() {
return countryRepository.findAll(Sort.by(Sort.Direction.ASC, "name"));
}

@Override
public List findDestinationByCountry(List countryIds) {
return destinationRepository.findByCountryIdIn(countryIds);
}
}

Интерфейс CountryRepository

Код: Выделить всё

package com.tkg.product.repository;

import com.tkg.product.entity.Country;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Component;

@Component
public interface CountryRepositoryInterface extends JpaRepository {
}

Я пробовал заменить @Component на @Repository, но все по-прежнему.
Спасибо всем

Подробнее здесь: https://stackoverflow.com/questions/776 ... t-be-found
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

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