Java添加构造方法异常异常——Could not autowire. there is more than one bean of '' type

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shijing266/article/details/84034696

在写一个Test类的时候,为这个Test天加一个带参构造方法,但是对构造方法的入参提示:

Could not autowire. there is more than one bean of '' type

开始有点摸不着头脑,后面仔细一想, 难道是影响这个类在其他地方注入了?   注入默认都是用的无参构造方法。 于是自己在加了一个无参构造方法,问题解决!

猜你喜欢

转载自blog.csdn.net/shijing266/article/details/84034696