Junit 启动报错是动态代理的原因吗?

错误提示:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerController': Unsatisfied dependency expressed through field 'customerApiToSF'; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'customerApiToSF' is expected to be of type 'com.business.basedata.cust.web.CustomerApiToSF' but was actually of type 'com.sun.proxy.$Proxy105'

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586)

at

描述;使用junit单元测试报错

代码:单元测试代码
报错类的代码:
依赖注入代码:
请大佬们看看是什么原因导致的错误!!感谢大佬们伸出援手,有知道的大佬吗?


回答:

好像是CustomerApiToSF这个类被代理了,是不是有aop相关配置

以上是 Junit 启动报错是动态代理的原因吗? 的全部内容, 来源链接: utcz.com/p/944837.html

回到顶部