org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with nam

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with nam
这个异常是由于Spring在applicationContext.xml中bean的autowirte装配类型时出现问题。

出现这个异常是我在测试SpringJunit4获取dao操作数据库时bean没有进入spring的ioc管理,

去看下你mvc每层的类前都加好标注了没有我只看dao包就可以

controller 包下--》@Controller

service 包下---》   @Service

若时dao包下出现  -----》@mapper(整合mybatis时)

再查看spring中的mybatis对dao接口的Mapper扫描,

最后还出现这个异常再去看看pom.xml里有没有将jar包配置重复或丢失。

猜你喜欢

转载自blog.csdn.net/luguodehua/article/details/80327886