Error creating bean with name ‘loginController‘: Unsatisfied dependency expressed through field ‘use

本文记录了一次Springboot项目中出现的依赖注入失败问题及其解决过程。问题源于JdbcType不支持int类型,通过调整为INTEGER类型后,成功解决了注入失败的问题。
部署运行你感兴趣的模型镜像

测试Springboot时报了这个错误

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'loginController': Unsatisfied dependency expressed through field 'userService';

上网搜了解决方法,大多数原因是缺少接口实现类上注解@Service导致注入失败,或者Mapper.xml文件中注释不规范。

找了半天,也没找到自己想要的答案。

后来不经意间看到了这个错误信息:

Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.type.JdbcType.int

原来是JdbcType不支持int类型啊。。。换成INTEGER后重启立马好了

看来错误信息还是要仔细看啊,不能一报错就直接上网找解决方法。

浪费我几个小时,长记性了。

您可能感兴趣的与本文相关的镜像

Llama Factory

Llama Factory

模型微调
LLama-Factory

LLaMA Factory 是一个简单易用且高效的大型语言模型(Large Language Model)训练与微调平台。通过 LLaMA Factory,可以在无需编写任何代码的前提下,在本地完成上百种预训练模型的微调

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值