问题描述
启动时报错,大致意思就是service里面有一个接口,一个实现类,spring容器不知道该用哪一个
下面是报错
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.userInfo.service.IUserService' available: expected single matching bean but found 2: userServiceImpl,IUserService
解决:
网上的解决方法有很多,比如在注解上指定名称或者type,我没有这么做,因为太麻烦
我是改了启动类的扫描对象
原来的
现在改了以后的