Springboot启动报错org.s.b.f.UnsatisfiedDependencyException: Error creating bean with name ‘student‘

这篇博客探讨了在使用Spring框架时遇到的bean创建错误,特别是关于'org.springframework.beans.factory'包中的依赖注入问题。博主指出,为Student类添加无参构造方法并实现set方法可以成功解决这一问题,从而确保文件依赖项的正确配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在这里插入图片描述

一.报错解释:

org.springframework.beans.factory包中不满足的依赖错误 :创建文件依赖项中定义的名为“student”的bean时出错

二.解决方案:

在Student类中添加一个无参构造方法public Student(){},问题解决.tips:别忘了加set方法
好久没写博客了 最近发生了很多事 凑合着看吧

2025-04-03 08:57:06.947 WARN 18528 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentController': Unsatisfied dependency expressed through field 'studentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentServiceImp': Unsatisfied dependency expressed through field 'studentMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.bigdata.springbootmybatis.mapper.StudentMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 2025-04-03 08:57:06.948 INFO 18528 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2025-04-03 08:57:06.964 INFO 18528 --- [ restartedMain] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-04-03 08:57:07.019 ERROR 18528 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Field studentMapper in com.bigdata.springbootmybatis.service.imp.StudentServiceImp required a bean of type 'com.bigdata.springbootmybatis.mapper.StudentMapper' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true) Action: Consider defining a bean of type 'com.bigdata.springbootmybatis.mapper.StudentMapper' in your configuration.怎么回事
最新发布
04-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值