exceptions.JedisConnectionException: Could not get a resource from the pool at org.springframework.
来源:互联网 发布:数控编程帅气宝塔图纸 编辑:程序博客网 时间:2024/05/21 17:51
exceptions.JedisConnectionException: Could not get a resource from the pool at org.springframework.
今天遇到奇葩问题:
别人的项目说redis能给链接上,就我的不行。
别人的项目说redis能给链接上,就我的不行。
排查思路:
一、检查redis是不是挂了
一、检查redis是不是挂了
二、看看是不是防火墙开启
三、检查配置文件
我的问题出在配置文件上面,
系统里面有2套redis操作代码。
一套用的是“
redis.clientsjredis”
<dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version> </dependency>
另一套用的是“
spring-boot-starter-redis”
<!-- 集成redis --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-redis</artifactId> <version>1.4.3.RELEASE</version> <exclusions> <exclusion> <artifactId>jcl-over-slf4j</artifactId> <groupId>org.slf4j</groupId> </exclusion> <exclusion> <artifactId>jul-to-slf4j</artifactId> <groupId>org.slf4j</groupId> </exclusion> </exclusions> </dependency>
这2套的配置文件的host不一样,jredis用的叫hostName
而spring-boot-starter-redis用的叫host
所以链接不上,原因是根本就没有配host,解决办法就是陪2个,一个为host,一个为hostName 修改如下:spring: redis: host: **.**.**.** hostName: **.**.**.** port: 6379 password: ****** pool: max-active: 8 max-wait: -1 max-idle: 8 min-idle: 0 timeout: 0 database: 4其他解决方案:
解决办法一:
1.关闭防火墙:
查看防火墙状态:
- 1
暂时关闭防火墙:
- 1
禁止防火墙在系统启动时启动
- 1
解决方法二:
将redis.conf中的bind 127.0.0.1注释掉
阅读全文
0 0
- exceptions.JedisConnectionException: Could not get a resource from the pool at org.springframework.
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- 、redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- 异常:redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
- redis JedisConnectionException: Could not get a resource from the pool
- 报错JedisConnectionException: Could not get a resource from the pool
- 报错JedisConnectionException: Could not get a resource from the pool 已解决。(不是代码问题,Tomcat缓存问题)
- Could not get a resource from the pool
- Could not get a resource from the pool 错误分析
- Could not get a resource from the pool
- Redis:Could not get a resource from the pool
- 算法导论(一)1、算法基础-简介
- 从手工打造到工厂设计模式的演变历程
- json存取值方式
- 第二周项目1 C/C++语言中函数参数传递的三种方式--传值方式
- 4.计算数据的平均数和最值
- exceptions.JedisConnectionException: Could not get a resource from the pool at org.springframework.
- Leetcode188. Best Time to Buy and Sell Stock IV
- svn之——linux下清除svn的用户名和密码
- LIVE555再学习 -- DM368/Hi3516A 交叉编译
- 自定义ViewDemo-刮刮乐
- tomcat加入某一项目后启动失败:failed to start
- delphi多线程例子 采用createThread创建多线程
- Thinking in Java(Fourth Edition)2.11
- apk反编译详细教程