nested exception is redis.clients.jedis.exceptions.JedisConnectionExcep 解决方法

本文介绍了在使用Jedis时遇到的'JedisConnectionException'问题,问题可能源于配置错误或Redis服务器未运行。解决方案包括检查properties文件中的Jedis配置,确保端口正确,以及确保Redis服务器已启动。

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


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'OrdersIteamController' defined in file [C:\Users\Administrator\Desktop\book\web\target\classes\com\siner\web\OrdersIteamController.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.siner.web.OrdersIteamController]: Constructor threw exception; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1320) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]

如图,我使用Jedis抓不到连接池里的jedis链接,也就是说连接池中没有可用的jedis。
产生这种问题原因我大概发现了2种:

1、properties文件里jedis的配置有问题,要么是写错了,要么是没设置好端口 在这里插入图片描述
2、你没有打开redis 服务器,就是那个CMD小黑框。

在这里插入图片描述
在这里插入图片描述
搞好后,启动IDEA,芜湖 起飞,完美启动

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值