Я определил интерфейс под названием EntitySpecRepository, и он имеет пять реализаций, как показано ниже.
Код: Выделить всё
@Service
public interface EntitySpecRepository {
...
}
Код: Выделить всё
@Service
@ConditionalOnProperty(value = "am.search.els.enabled", havingValue = "true")
@DependsOn(value = {"elasticIndexUtility"})
public class ElsEntitySpecRepositoryImpl extends EntitySpecRepositoryImpl {
...
}
Код: Выделить всё
@Service("entitySpecRepoRestClient")
public class EntitySpecRepoRestClient implements EntitySpecRepository {
...
}
Код: Выделить всё
public abstract class EntitySpecRepositoryImpl extends EntitySpecRepositoryHelper implements
ImpactedEntitySpecRepository {
....
}
Код: Выделить всё
public interface ImpactedEntitySpecRepository extends EntitySpecRepository {
....
}
Код: Выделить всё
public class ImpactedEntitySpecRepositoryImpl extends EntitySpecRepositoryImpl {}
Я получаю ошибку ниже:
Код: Выделить всё
Field entitySpecRepository in com.xyz.abc.spec.service.ProductSpecReloadService required
a bean of type 'com.xyz.abc.sdk.repo.EntitySpecRepository' that could not be found.
Код: Выделить всё
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Код: Выделить всё
@Autowired
private EntitySpecRepository entitySpecRepository;
Я проверил каталог basePackage, он тот же, изменений нет.
Это должно работать, если они находятся в одном пакете, bean-компонент создание должно пройти успешно.
Любая помощь будет оценена по достоинству.
Подробнее здесь: https://stackoverflow.com/questions/790 ... 2-to-3-3-3
Мобильная версия