Je reçois l'erreur suivante:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method setApplicant in webService.controller.RequestController required a bean of type 'com.service.applicant.Applicant' that could not be found.
Action:
Consider defining a bean of type 'com.service.applicant.Applicant' in your configuration.Je n'ai jamais vu cette erreur auparavant, mais il est étrange que @Autowire ne fonctionne pas. Voici la structure du projet:
Interface du candidat
public interface Applicant {
    TApplicant findBySSN(String ssn) throws ServletException;
    void deleteByssn(String ssn) throws ServletException;
    void createApplicant(TApplicant tApplicant) throws ServletException;
    void updateApplicant(TApplicant tApplicant) throws ServletException;
    List<TApplicant> getAllApplicants() throws ServletException;
}DemandeurImpl
@Service
@Transactional
public class ApplicantImpl implements Applicant {
private static Log log = LogFactory.getLog(ApplicantImpl.class);
    private TApplicantRepository applicantRepo;
@Override
    public List<TApplicant> getAllApplicants() throws ServletException {
        List<TApplicant> applicantList = applicantRepo.findAll();
        return applicantList;
    }
}Maintenant, je devrais pouvoir simplement utiliser Autowire Applicant et pouvoir y accéder, mais dans ce cas, cela ne fonctionne pas lorsque je l'appelle dans mon @RestController:
@RestController
public class RequestController extends LoggingAware {
    private Applicant applicant;
    @Autowired
    public void setApplicant(Applicant applicant){
        this.applicant = applicant;
    }
    @RequestMapping(value="/", method = RequestMethod.GET)
    public String helloWorld() {
        try {
            List<TApplicant> applicantList = applicant.getAllApplicants();
            for (TApplicant tApplicant : applicantList){
                System.out.println("Name: "+tApplicant.getIndivName()+" SSN "+tApplicant.getIndSsn());
            }
            return "home";
        }
        catch (ServletException e) {
            e.printStackTrace();
        }
        return "error";
    }
}------------------------ MISE À JOUR 1 -----------------------
J'ai ajouté
@SpringBootApplication
@ComponentScan("module-service")
public class WebServiceApplication extends SpringBootServletInitializer {
    @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(WebServiceApplication.class);
    }
    public static void main(String[] args) {
        SpringApplication.run(WebServiceApplication.class, args);
    }
}et l'erreur est partie mais rien ne s'est produit. Cependant , lorsque je commentais sur tout ce qui touche à Applicantla RestControlleravant d'ajouter que @ComponentScan()j'ai pu retourner une chaîne la UI, ce qui signifie donc mon RestControllertravaillait, maintenant il est sauté. Je moche Whitelabel Error Pagemaintenant.
--------------------- MISE À JOUR 2 --------------------------- ---
J'ai ajouté le paquet de base du haricot dont il se plaignait. L'erreur lit:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method setApplicantRepo in com.service.applicant.ApplicantImpl required a bean of type 'com.delivery.service.request.repository.TApplicantRepository' that could not be found.
Action:
Consider defining a bean of type 'com.delivery.request.request.repository.TApplicantRepository' in your configuration.J'ai ajouté @ComponentScan
@SpringBootApplication
@ComponentScan({"com.delivery.service","com.delivery.request"})
public class WebServiceApplication extends SpringBootServletInitializer {
    @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(WebServiceApplication.class);
    }
    public static void main(String[] args) {
        SpringApplication.run(WebServiceApplication.class, args);
    }
}---------------------------- Mise à jour 3 -------------------- -
ajouter:
@SpringBootApplication
@ComponentScan("com")
public class WebServiceApplication extends SpringBootServletInitializer {se plaint toujours de ma ApplicantImplclasse dans laquelle @Autowiresmon dépôt TApplicantRepositoryen elle.