Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not autowire. No beans of 'CityDao' type found. #3

Closed
blue-troy opened this issue Apr 13, 2017 · 16 comments
Closed

Could not autowire. No beans of 'CityDao' type found. #3

blue-troy opened this issue Apr 13, 2017 · 16 comments

Comments

@blue-troy
Copy link

你好,我clone了你的项目,发现在idea下 package org.spring.springboot.service.impl 中的 @Autowired
private CityDao cityDao;
出现了Could not autowire. No beans of 'CityDao' type found. 提示,不知是什么原因。

@JeffLi1993
Copy link
Owner

which 子工程?

@blue-troy
Copy link
Author

springboot-learning-example/springboot-mybatis/

@JeffLi1993
Copy link
Owner

mvn clean install -U .估计没打包好

@squallssck
Copy link

是ideal的问题,运行是没有问题的. 但是就是会有红线提示比较讨厌.

@squallssck
Copy link

http://www.cnblogs.com/zhangdong92/p/6986653.html
可以看下这里的一个解决方法

@hbbliyong
Copy link

你的解决了吗,我也是这个问题,如果解决请告知

@adonis-lau
Copy link

adonis-lau commented Sep 4, 2017

感觉是up代码写的有些问题。
在CityDao类加上 @repository 就好了。

@zhonghuazhi
Copy link

我这边运行 执行报错,提示如下:
Description:

Field cityDao in net.cc.restful.service.impl.CityServiceImpl required a bean of type 'net.cc.restful.dao.CityDao' that could not be found.

Action:

Consider defining a bean of type 'net.cc.restful.dao.CityDao' in your configuration.

@JeffLi1993
Copy link
Owner

fix

@Applevegetable
Copy link

dao层加@repository

@GitHubXuMing
Copy link

GitHubXuMing commented Aug 2, 2022 via email

@chenzl0723
Copy link

chenzl0723 commented Aug 2, 2022 via email

@VitorTao
Copy link

VitorTao commented Aug 2, 2022 via email

@Jokeridea
Copy link

Jokeridea commented Aug 2, 2022 via email

@chenzl0723
Copy link

chenzl0723 commented Oct 11, 2022 via email

@VitorTao
Copy link

VitorTao commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests