仰望晴空的网痴
2021-02-03 15:44
采纳率: 100%
浏览 194
已采纳

项目同时加上@Service@Autowired@MyBatisDao注解后运行项目报错如何解决?

Description:

Field dao in com.jeesite.common.service.QueryService required a single bean, but 58 were found:
	- companyDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/CompanyDao.class]
	- postDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/PostDao.class]
	- employeePostDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/EmployeePostDao.class]
	- employeeOfficeDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/EmployeeOfficeDao.class]
	- msgInnerDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/msg/dao/MsgInnerDao.class]
	- empUserDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/EmpUserDao.class]
	- msgInnerRecordDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/msg/dao/MsgInnerRecordDao.class]
	- logDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/LogDao.class]
	- companyOfficeDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/CompanyOfficeDao.class]
	- areaDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/AreaDao.class]
	- officeDao: defined in URL [jar:file:/D:/maven/repository/com/jeesite/jeesite-module-core/4.1.5-SNAPSHOT/jeesite-module-core-4.1.5-20190802.104614-4.jar!/com/jeesite/modules/sys/dao/OfficeDao.class]
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • lin351550660 2021-02-03 16:20
    已采纳

    mapper.xml  检查一下包名吧  显然没有找到类

    已采纳该答案
    评论
    解决 1 无用
    打赏 举报
  • 封印di恶魔 2021-02-03 16:40

    @Autowired不是加在类上的,这个是加在变量上,从spring里注入变量的

    评论
    解决 1 无用
    打赏 举报
  • APX456 2021-02-03 15:48

    代码呢 发出来啊

    评论
    解决 无用
    打赏 举报
  • @Service是放在接口实现类上面的

    @Autowired是注入变量用的

    @MyBatisDao是声明mapper用的

    不明白。到底想干什么

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题