新人刚开始接触启动若依框架时的报错问题

 报错问题1:redis无法连接

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'captchaController': Unsatisfied dependency expressed through field 'configService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysConfigServiceImpl': Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to ……

排查问题:检查了一下redis的启动,发现完全没有问题,也是正常运行在6379的默认端口

解决问题:重新启动了下redis,然后重新启动若依应用,发现可以运行。

复盘:在第一次启动redis的时候没有指定配置文件,而是直接使用redis-server 启动,后续重新启动了redis并且加上配置文件启动: redis-server /etc/redis.conf 之后,若依框架就能正常运行。

所以这里我的原因是没有正确启动redis并选择恰当的配置文件,属于redis配置问题,配置中需要添加类似 bind 0.0.0.0 从而允许所有IP访问。(但实际上我没有再深入求证根本原因是不是这个配置的问题)

 报错问题2:

这个问题是发生在问题1之前的,是mysql数据库的问题导致应用启动出错。

后来发现是数据库的名字写错了,或者说没有把若依框架的默认数据库名称改成自己的数据库名称,错误非常低级,但是我不是第一次犯这种错误了,所以也记录一下。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值