一、报错信息
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'statisticsServiceImpl' is expected to be of type 'cn.xbao.pet.service.impl.StatisticsServiceImpl' but was actually of type 'com.sun.proxy.$Proxy43'
二、原因
没有遵循Spring的代理机制,错误地使用类注入:
三、解决
面向接口编程,接口注入: