Error creating bean with name 'goodsInfoController': Unsatisfied dependency expressed through field 'service'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.lt.fresh.service.IGoodsInfoService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

创建goodsInfoController出错,未满足的依赖项通过字段“service”
找到GoodsInfoServiceImpl类 ,发现没有写注解@Service
本文详细解析了在Spring框架中创建goodsInfoController时遇到的依赖注入失败问题,具体表现为未找到符合条件的IGoodsInfoService实现类。文章深入探讨了解决方案,包括正确使用@Service注解标记GoodsInfoServiceImpl类,确保其能被Spring容器识别并完成自动装配。
1万+

被折叠的 条评论
为什么被折叠?



