IDEA中配置文件格式改成springboot的配置文件格式

今天刚从git上拉代码下来,然后一运行项目,一直报错

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aspDnidController': Unsatisfied dependency expressed through field 'aspDnidService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aspDnidServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aspDnidMapper' defined in file [E:\code\LRIT\lrit\common\target\classes\cn\ctticsh\lrit\common\mapper\basedata\AspDnidMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

但奇怪的是,其他同事拉下来运行都是好好的,没有报错....就我这边一启动项目之后报错了,,简直有毒,,上网查了一下,,没找到解决方法,,然后我觉得不科学,怎么可能同事运行没错,就我运行有问题,

【解决之路】

然后我就仔细看了一下,终于发现有点问题了,这边项目默认用IDEA打开的时候application.yml长这个样子,看着就不太对劲,

一般正常的springboot项目的配置文件应该是长这个样子的

然后我就改下配置,右键项目----->Open Moudel Setting

默认是这个Sources,

这边需要改成Resources,然后保存

可以看到这边已经变成正常的配置文件格式,然后启动项目就正常了,没有报错了

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值