Spring Autowiring Service doesn't work in my Controller

前端 未结 7 1973
时光说笑
时光说笑 2021-02-04 13:43

i\'ve problems in order to autowire a service in my controller. I\'ve this error:

org.springframework.beans.factory.BeanCreationException: Error creating bean wi         


        
7条回答
  •  别跟我提以往
    2021-02-04 14:35

    when ever you face such kind of problem kindly check, what is the path for context:component-scan basepackage

    it should be root name Like if I am taking com.mike as package name & which contain bean,controller,dao,service folder in its structure then, in such condition you have to follow Like ----context:component-scan basepackaage="com.mike.*"

    where * means all the folder (bean,service,dao,controller and theie corresponding classes) will be scaned.

提交回复
热议问题