记录SpringBoot启动错误,Error creating bean with name ‘loginController‘: Unsatisfied dependency expressed

本文记录了一次SpringBoot项目启动失败的问题排查过程,错误源于UserMapping.xml文件中同时使用了resultType和resultMap属性,导致依赖注入失败。通过调整XML配置,解决了loginController的依赖问题。

记录SpringBoot启动错误,Error creating bean with name ‘loginController’: Unsatisfied dependency expressed

最开始以为业务类没加@Service注解,结果不是这个原因。

我也不知道自己为什么会突然想到是不是UserMapping.xml文件错误
结果还真是,原代码:
在这里插入图片描述

同时出现了resultType和resultMap;
就这么简单,不能同时出现resultType和resultMap,具体原因还在百度中。。。找到原因会记录下来

springboot项目启动报错[2025-07-16 10:45:00.414] WARN - [] - [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'loginController': Unsatisfied dependency expressed through field 'reminderDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'reminderDetailsService': Unsatisfied dependency expressed through field 'reminderDetailsDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'reminderDetailsDao' defined in file [D:\code-repository\rob-irobotquery-parent\target\classes\com\aia\icustomer\rob\robquery\dao\ReminderDetailsDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/JndiDataSourceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException: Failed to look up JNDI DataSource with name 'java:comp/env/jdbc/icsp_ngs'; nested exception is javax.naming.NameNotFoundException: 名称[jdbc/icsp_ngs]未在此上下文中绑定。找不到[jdbc]。
07-17
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值