Я внедряю List<Reception>
в класс ReceptionService
, но все, что я получаю, это ошибка, и проект не будет развернут: Ошибка, которую я получаю:
Unsatisfied dependencies for type List<Reception> with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject com.github.adminfaces.starter.service.ReceptionService.selectedPatients
at com.github.adminfaces.starter.service.ReceptionService.selectedPatients(ReceptionService.java:0)
Я установил bean-discovery-mode="all"
к beans.xml уже
Класс PatientList
, где List<Reception> selectedPatients
имеет свои методы получения и установки
import com.github.adminfaces.starter.model.Reception;
import com.github.adminfaces.starter.service.ReceptionService;
import org.omnifaces.cdi.ViewScoped;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@Named
@ViewScoped
public class PatientListMB implements Serializable {
@Inject
ReceptionService receptionService;
Integer id;
LazyDataModel<Reception> patients;
Filter<Reception> filter = new Filter<>(new Reception());
List<Reception> selectedPatients; //patients selected in checkbox column
List<Reception> filteredValue;// datatable filteredValue attribute (column filters)
Класс ReceptionService
, в который я делаю инъекцию List<Reception> selectedPatients
package com.github.adminfaces.starter.service;
import com.github.adminfaces.starter.infra.model.Filter;
import com.github.adminfaces.starter.infra.model.SortOrder;
import com.github.adminfaces.starter.model.Reception;
import com.github.adminfaces.template.exception.BusinessException;
import javax.ejb.Stateless;
import javax.inject.Inject;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import static com.github.adminfaces.template.util.Assert.has;
/**
* @author rmpestano
* Reception Business logic
*/
@Stateless
public class ReceptionService implements Serializable {
@Inject
List<Reception> selectedPatients;