2016-02-11 2 views
0

У меня есть следующий код:Spring Ошибка загрузки проекта создания боб

package com.frameworkonly.webapp; 

import java.util.ArrayList; 

import org.springframework.beans.factory.annotation.Autowired; 
import org.springframework.boot.SpringApplication; 
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 
import org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration; 
import org.springframework.context.annotation.ComponentScan; 
import org.springframework.stereotype.Controller; 
import org.springframework.ui.Model; 
import org.springframework.web.bind.annotation.RequestMapping; 

import com.frameworkonly.webapp.domain.Employee; 
import com.frameworkonly.webapp.service.EmployeeServiceInterface; 

@EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class}) 
@ComponentScan("com.frameworkonly.webapp") 
public class SpringBootDemoApplication { 

    @Autowired 
    EmployeeServiceInterface employeeServiceInterface; 

    public static void main(String[] args) { 
     SpringApplication.run(SpringBootDemoApplication.class, args); 
    } 
} 

Я только начал с Spring Boot. Это дает мне следующее сообщение, и я не знаю, что это значит:

Error creating bean with name 'springBootDemoApplication': Injection of 
autowired dependencies failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Could not autowire 
field: com.exemple.service.PatientServiceInterface 
com.example.SpringBootDemoApplication.patientServiceInterface; nested 
exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
No qualifying bean of type [com.exemple.service.PatientServiceInterface] 
found for dependency: expected at least 1 bean which qualifies as autowire 
candidate for this dependency. 

ответ

1

Добавить com.exemple.service в список проверяемых пакетов, предполагающих PatientServiceInterface помечается @Service

@ComponentScan({"com.frameworkonly.webapp","com.exemple.service"}) 
+0

спасибо он работал: DD –

+0

не забудьте принять этот ответ :) – Reimeus

+0

ах жаль нового здесь спасибо: D –

Смежные вопросы