wq8660389
2016-12-06 02:15
采纳率: 35.7%
浏览 1.7k
已采纳

java ssm框架的问题

WARN support.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException:

Error creating bean with name 'loginServiceImpl': Unsatisfied dependency expressed through field 'adminDao': No qualifying bean of type [com.dabay.service.web.manager.Dao.AdminDao] found for dependency [com.dabay.service.web.manager.Dao.AdminDao]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.dabay.service.web.manager.Dao.AdminDao] found for dependency [com.dabay.service.web.manager.Dao.AdminDao]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'loginServiceImpl': Unsatisfied dependency expressed through field 'adminDao': No qualifying bean of type [com.dabay.service.web.manager.Dao.AdminDao] found for dependency [com.dabay.service.web.manager.Dao.AdminDao]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.dabay.service.web.manager.Dao.AdminDao] found for dependency [com.dabay.service.web.manager.Dao.AdminDao]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • 無心_ 2016-12-06 02:25
    已采纳

    1.这个adminDao如果没配置的话,需要进行配置,id不要重复了
    2.adminDao如果已经配置,建议使用@Qualifier("adminDao")进行标注说明你到底要使用哪个dao
    3.建议对dao层进行自动注入配置


    希望对你有所帮助,不对的地方请见谅

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • 传说中的神话灬 2016-12-06 03:20

    回答了也没有赏金,就知道忽悠人,不告诉你们了,小气

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题