Bean named '*' must be of type [*], but was actually of type [com.sun.proxy.$Proxy34]

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014679795/article/details/52061524
org.springframework.beans.factory.BeanNotOfRequiredTypeException: 
Bean named 'menuDao' must be of type [com.panzy.dao.MyMenuDao], but was actually of type [com.sun.proxy.$Proxy34]

检查注解的名字是否和类型名一致,Spring注入失败导致的错误。

修改前
@Resource
private MyMenuDao menuDao;

修改后
@Resource
private MyMenuDao myMenuDao;

@Resource("myMenuDao")
private MyMenuDao menuDao;

阅读更多
换一批

没有更多推荐了,返回首页