wq8660389
wq8660389
采纳率35.7%
2016-12-06 02:15

java ssm框架的问题

15
已采纳

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条回答

  • linan123456789 無心_ 5年前

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


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

    点赞 1 评论 复制链接分享
  • sinat_35134348 传说中的神话灬 5年前

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

    点赞 评论 复制链接分享

相关推荐