经典的SSH框架出现的依赖注入错误问题。

版权声明:博主最近都在,有不懂疑惑的,可以一起交流,也希望能有高人指点一二,谢啦!本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_40295575/article/details/82722973

    Bean named 'articleService' must be of type [com.cst.znkg.service.ArticleService], but was actually of type [com.cst.znkg.service.impl.ArticleServiceImpl]
    Error creating bean with name 'userAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'articleService' must be of type [com.cst.znkg.service.ArticleService], but was actually of type [com.cst.znkg.service.impl.ArticleServiceImpl]
    Unable to instantiate Action, userAction, defined for 'user_infoList' in namespace '/'Error creating bean with name 'userAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'articleService' must be of type [com.cst.znkg.service.ArticleService], but was actually of type [com.cst.znkg.service.impl.ArticleServiceImpl]

File: 	org/springframework/beans/factory/support/AbstractBeanFactory.java

在做项目的时候,前期偷懒,为了方便都把service给写了出来,但是serviceimpl却没有实现对应的service方法,然后在配置那又注入了,所以导致了这种问题。

解决方法:就是补全。

猜你喜欢

转载自blog.csdn.net/weixin_40295575/article/details/82722973