redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool?

我本地项目跑起来后执行某个添加功能会出现异常 报错信息如下:
图片说明

图片说明

redis服务肯定是起来了,原先功能是能用,后来出现过一次这个问题,当时的原因是因为起redis服务的时候密码没有设置,设置下密码就可以,没过两天又出现这个问题,搞了一天没弄明白为什么。
我也是第一次用redis,求教大神这个问题如何jie'jue

0

1个回答

是不是没连上Redis?Redis地址、端口、密码是否正确呢

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Redis错误及解决方案
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/session/data/re
记一次使用Jedis客户端获取不到资源(Could not get a resource from the pool)的填坑经历
经历描述:本人联合一狗蛋开发一个小APP,本人负责服务器的开发,狗蛋负责APP的开发。登录验证使用到了Redis做Token缓存,于是使用了Jedis库来操作阿里云服务器上的Redis。项目一开始,我便随便从网上找了别人封装好了的Jedis的工具类,想着无非就是往Redis中做一些增删查操作,网上关于Redis+Token的资源很多,直接从网上下载后整合到自己项目中了,并没有想到以后会有什么问题。...
redis使用中经常出现 Could not get a resource from the pool 异常,解决办法总结
背景: 最近使用jedis(redis)开发一项功能,查阅日志发现,服务运行一段时间之后,就会出现 redis.clients.jedis.exceptions.JedisException: Could not get a resource from the pool 的异常, 重启就好了,但是过一段时间又出现这种情况; 我这里问题比较简单,释放连接的方法忘记调用了,应该是没有及时释放连...
细心和经验很重要,redis链接失败:Could not get a resource from the pool你遇到了吗?
org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from...
Redis一个异常的解决办法,异常描述:Could not get a resource from the pool
    Redis一个异常的解决办法,异常描述:Could not get a resource from the pool   redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at redis.clients.ut...
contos新搭建的redis集群,使用客户端可以连接,但使用JedisCluster连接报Could not get a resource from the pool异常
最近搭建redis集群,环境放在阿里云上,系统使用centos6.8。在搭建完成以后,指令可以连接,redis客户端也可以连接,但在java中使用JedisCluster报无法从连接池内获得连接.(Could not get a resource from the pool)。两天内经过网上看到很多解决方案,一直没能解决我当前的问题。最后看到 "kurama2018" 写的文章后,才能得以解决。...
使用redis中遇到的问题记录
1.redis批量删除key       redis-cli keys '*' | xargs redis-cli del 2.从连接池获取jedis链接,不需要进行关闭操作,如果关闭会报redis.clients.jedis.exceptions.JedisException: Could not return the resource to the pool异常,原因是多个线程会用同
redis连接异常的解决方案
redis连接异常的解决方案 最近在做高并发架构,发现程序偶尔报错: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at redis.clients.util.Pool.getResource(Pool.java:50) ~[Po
redis获取异常或者获取不到
异常: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource...
获取Redis连接池实例报错及解决方案( Could not get a resource from the pool)
描述: 这个错误产生的前提是这样的,将数据存入redis(新安装的)中,在通过连接池获取jedis实例时,产生如下错误( Could not get a resource from the pool)。 分析: 由于是新安装的redis,配置文件没有更改,低级的错误浪费不少时间,写一篇文章,让同样犯这种错误的朋友别再浪费时间。 解决: 更改配置文件 redis.conf 中两处 1.将 bind ...
Jedis连接Redis问题记录
今天在用Jedis连接Redis数据库时,不停的报出以下错误,搜罗网上各种信息,也没解决。 因为我是在本地安装的虚拟机,在虚拟机安装的Redis,以下是我报错的代码: public class JedisAdapter { public static void print(int index,Object obj) { System.out.println(Strin...
JedisConnectionException: Could not get a resource from the pool
前辈们,您们好:rn 硬件:win7 64bit webloginc 10.3 (32bit)/java 1.6(安装weblogic使用的自带Java版本)rn 我使用weblogic部署wap环境后登录(在进入debug之前就会异常),就会出现“不能从连接池获取资源”异常,具体如下:rnat redis.clients.util.Pool.getResource(Pool.java:22)rn at com.ai.log.util.redis.RedisManager.getJedis(RedisManager.java:64)rn at com.ai.log.client.RedisLogAppend.getJedis(RedisLogAppend.java:87)rn at com.ai.log.client.RedisLogAppend.append(RedisLogAppend.java:48)rn at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)rn at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)rn at org.apache.log4j.Category.callAppenders(Category.java:187)rn at org.apache.log4j.Category.forcedLog(Category.java:372)rn at org.apache.log4j.Category.error(Category.java:286)rn……(此处省略更多行)rnCaused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed outrn at redis.clients.jedis.Connection.connect(Connection.java:134)rn at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:69)rn at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1665)rn at redis.clients.jedis.JedisPool$JedisFactory.makeObject(JedisPool.java:72)rn at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840)rn at redis.clients.util.Pool.getResource(Pool.java:20)rn ... 79 morernCaused by: java.net.SocketTimeoutException: connect timed outrn at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)rn at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)rn at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)rn at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)rn at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)rn at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)rn at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)rn at java.net.Socket.connect(Socket.java:579)rn at redis.clients.jedis.Connection.connect(Connection.java:129)rn ... 84 morern我使用过的方法:1、更改redis.properties配置(非-1、大数字也试过)rnMaxActive=-1rnMaxIdle=-1rnMaxWait=10000rn2、试过安装官网通用版weblogic 10.X;rn3、考虑更换Tomcat部署,但是配置文件太多(15个),不知道如何部署。rn4、修改过weblogic里一个什么=64 的;//适用于64位系统rn5、防火墙已关闭,Jedis不知如何判断是否启动;rn6、中国移动wap的jedis版本不可能低于2.4.2吧;rnrn 发梢挠到后脑勺,异常坚强如磐石。愁~ 瞅 ~ 愁~rn
Redis一个异常的解决办法,异常描述:Could not get a resource from the pool
异常描述:  [java] view plaincopy redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool       at redis.clients.util.Pool.getResource(Pool.ja
通过jedis连接redis单机成功,使用redis客户端可以连接集群,但使用JedisCluster连接redis集群一直报Could not get a resource from th
问题:这个地方IP的问题,以上是正确的版本,以前有问题的版本的Ip是127.0.0.1, 原因是这个地方以前我没注释redis.conf文件中的bind 127.0.0.1 然后做集群时使用的命令是: ./redis-trib.rb create –replicas 1 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 12...
dubbo-admin的部署搭建以及zookeeper安装
1、首先在dubbo官网下载dubbo-admin压缩包 https://github.com/apache/incubator-dubbo/tree/dubbo-2.6.0 下载完成后,解压可以看到当前目录中包含dubbo-admin这个目录 2、进入到dubbo-admin目录下,执行以下命令(引号不要忘记加),对程序进行打包 mvn install '-Dmaven.t...
一次诡异的redis连接异常
一、异常出现  启动jar包报异常,异常信息如下,简单分析后初步定位为redis连接异常。 2018-10-23 15:24:00.781 ERROR kmessage [main] [org.springframework.boot.SpringApplication] - Application run failed org.springframework.context.Applic...
redis和session共享同时使用 报错
reids报错 /** * 注意如果 JedisConnectionFactory与JedisPool一起使用会报错<br/> * * @return */ @Bean @Order(2) // @ConfigurationProperties(prefix = "spring.redis") public...
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resour
[img=https://img-bbs.csdn.net/upload/201705/25/1495699716_692105.png][/img]rnrn @Autowiredrn public RedisTemplate redisTemplate;rnrncount = this.redisTemplate.opsForValue().increment(key, 1L).longValue();rn[img=https://img-bbs.csdn.net/upload/201705/25/1495699803_351299.png][/img]rn
记录一次redis异常
java操作redis,放数或者取数,从上手程度上看-不难。但是,一次一次的异常以及解决会让我们对redis client进一步了解。一个存数据的java redis客户端项目,测试时能够存放数十条数据,使用pipeline的方式。但是,一旦存放千万乃至亿级数据的时候,每次导入数据必定会报同一个错:connection reset                          Object ...
Kubernetes入门学习-十八-dashboard认证及分级授权
最近学习k8s遇到很多问题,建了一个qq群:153144292,交流devops、k8s、docker等 Kubernetes dashboard认证及分级授权 认证、授权 API server: Subject-->action-->object 认证 Token、tls、user/password 账号:UserAccount、ServiceAccount 授权 ...
redis和jedis搭建过程中遇到的问题
一、异常警告: Cannot get master address from sentinel running @ 127.0.0.1:26379. Reason: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect. Tryi
spring3+mybatis3框架整合 启动错误记录
第一个 [ERROR] 2014-08-13 15:00:16 org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate
如何解决Cannot get a connection, 及断点调试失效的问题
问题分析: Cannot get a connection, pool error Timeout waiting for idle object,顾名思义就是无法获取连接,连接池等待空闲的连接超时!出现这种情况的原因:在非事务的情况下进行数据库操作完毕后,没有及时关闭连接,使数据库的连接不能有效得到回收,一直到数据库的连接用完后再请求下一个空闲的连接的时,都无法在获取空闲的连接而导致Cannot
使用redis会报Could not get a resource from the pool
使用spring data redis的时候 会报Could not get a resource from the pool 百度试了下发现不能解决问题rnrn配置如下[code=text]rn rn rn rn rn rn rn rn rn rn [/code]rnrn[code=java]ApplicationContext applicationContext = applicationContext = new ClassPathXmlApplicationContext("applicationContext-redis.xml");rn StringRedisTemplate stringRedisTemplate = applicationContext.getBean(StringRedisTemplate.class);rn RedisTemplate redisTemplate = (RedisTemplate)applicationContext.getBean("redisTemplate");rn ValueOperations redis = redisTemplate.opsForValue();rn System.out.println(redis.get("test"));rnrn for (int i=0; i<3000; i++) rn ThreadT t = new ThreadT();rn t.setRedisTemplate(redisTemplate);rn t.start();rn [/code]rnrnrn[code=java]class ThreadT extends Thread rnrn RedisTemplate redisTemplate;rn rn public void run() rn while(true) rn ValueOperations redis = redisTemplate.opsForValue();rn System.out.println(redis.get("test"));rn rn rnrn public void setRedisTemplate(RedisTemplate redisTemplate) rn this.redisTemplate = redisTemplate;rn rn[/code]rnrn求大神解释一下rnrn[code=text]Caused by: java.net.ConnectException: Connection refused: connectrn at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)rn at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)rn at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)rn at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)rn at java.net.AbstractPlainSocketImpl.connect(Unknown Source)rn at java.net.PlainSocketImpl.connect(Unknown Source)rn at java.net.SocksSocketImpl.connect(Unknown Source)rn at java.net.Socket.connect(Unknown Source)rn at redis.clients.jedis.Connection.connect(Connection.java:136)rn ... 18 morernException in thread "Thread-1781" org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the poolrn2017-03-24 18:08:49,400 [Thread-2244] DEBUG [RedisConnectionUtils:204] - Closing Redis Connectionrn2017-03-24 18:08:49,400 [Thread-1454] DEBUG [RedisConnectionUtils:125] - Opening RedisConnectionrn at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:162)rn at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:251)rn at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:58)rn at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:128)rn at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:91)rn at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:78)rn at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:178)rn at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:153)rn at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:86)rn2017-03-24 18:08:49,400 [Thread-2516] DEBUG [RedisConnectionUtils:204] - Closing Redis Connectionrn at org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:43)rn at cn.slimsmart.redis.ThreadT.run(TestMain.java:34)rnCaused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the poolrn at redis.clients.util.Pool.getResource(Pool.java:42)rn at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:155)rn ... 10 morern2017-03-24 18:08:49,400 [Thread-2272] DEBUG [RedisConnectionUtils:204] - Closing Redis ConnectionrnCaused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connectrn at redis.clients.jedis.Connection.connect(Connection.java:141)rn at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:75)rn at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1716)rn at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:65)rn at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:819)rn at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:429)rn at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360)rn at redis.clients.util.Pool.getResource(Pool.java:40)rn ... 11 more[/code]
kubernetes v1.11.0 从代码编译到部署文档-部署
系统环境 [root@master-47-35 ansible]# uname -a Linux master-47-35 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux [root@master-47-35 ansible]# cat /etc/red...
dbcp连接池不合理的锁导致连接耗尽
应用报错,表象来看是连接池爆满了。 org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Canno
合买平台搭建配置https实践操作记录
1.合买平台搭建 Q1446595067 参考文档 haozbbs.com 2.访问方式简易说明 参考文档 haozbbs.com 前面一篇:traefik基础部署记录,介绍了最简单的http访问traefik,访问过程参考见下: client — (via http) —&amp;gt; traefik —- (via http) —-&amp;gt; services 现在要实践的是更安全也更...
彻底解决 Jedis 连接池 获取不到连接,连接放回连接池错误的问题
Could not get jedis from the pool.
MyEclipse+hibernate错误:Could not get list of suggested identity strategies from database解决
MyEclipse+hibernate错误:Could not get list of suggested identity strategies from database解决
JBoss无法创建连接
15:32:28,523 WARN  [JBossManagedConnectionPool] Unable to fill pool  org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception:
使用mysql的系统中常见sql错误
使用mysql的系统中常见的sql错误:   1.事务中某些表是非innodb类型。   SQLWarning ignored: SQL state 'HY000', error code '1592',   message [Unsafe statement written to the binary log using statement format since BINLOG...
用m2eclipse创建Maven项目时报错
用m2eclipse创建Maven项目时报错 问题: Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from http://repo1.maven.org/maven2 was cached in the loc
C3P0连接池连接异常错误解决
转自:http://hi.baidu.com/zhenuu/blog/item/b91661385ca23d2a96ddd871.html
spring和redis整合异常整理
记录 1、Unable to validate object异常信息如下:org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Coul
dbcp重连失败问题排查记录(timeout设置)
背景   前几天很悲剧,公司的oracle小型机据说是网卡驱动有问题,导致数据库整整挂了1个多小时,后来切换到了备份数据库上,可用性一下子跌倒了3个9。     在后续的某一天,凌晨3点进行了网卡升级,又从备份库重新切回主库的时,测试过程中发现dbcp的自动重连部分机器有问题。 问题描述 整个过程出现了两种错误日志:  异常1:    Caused by: java.sql.SQL...
SpringMVC 无法获取连接报错
在进行单元测试的时候,发现报错 Could not get JDBC Connection; nested exception is java.sql.SQLException:  jdbc.properties配置文件信息 driver=com.mysql.jdbc.Driver url=jdbc:mysql://127.0.0.1:3306/seckill?useUnicode=true&
Jedis常见的三个异常及解决方式
用Linux虚拟机Centos6.5搭建个redis,在用Jedis连接时遇到了各种问题 1.redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect 报错信息如下: 出现这个异常 是在防火墙关闭或者指定端口开启正常 而re...
Android Studio 使用中 遇到的那些奇奇怪怪的问题
--------------------------------------------------------------------------------------------------------------------------------------------------------------- 转载声明:本文来自https://blog.csdn.net/shijian...
解决storm1.1.1集群找不到nimbus异常
各应用程序及版本 storm1.1.1zookeeper3.4.10 拓朴结构 nimbus、ui:CentOS65Appsupervisor:CentOS65M1、CentOS65M2、CentOS65M3 配置文件 zoo.cfg,zookeeper仅安装在三台supervisor服务器 server.6=CentOS65M1:2888:3888 serve
AndroidStudio配置常见问题及解决
1,"Unable to access Android SDK add-on list..." 解决:直接点击cancel,取消后进入系统在SDK Manager中重新定位sdk文件夹的位置 2,第一次打开AS后出现”Could not download junit.jar (junit:junit:4.12)“ 解决:重新下载junit4.12,并将其放在...\Android S
文章热词 机器学习教程 Objective-C培训 交互设计视频教程 颜色模型 设计制作学习
相关热词 mysql关联查询两次本表 native底部 react extjs glyph 图标 大数据get学习 怎么学习互联网大数据