Jedis测试异常:connect timed out
来源:互联网 发布:java ee书籍 编辑:程序博客网 时间:2024/06/03 23:12
Jedis 测试时出现了一个问题,在网上找了好久才解决问题,原来是虚拟机防火墙的问题。问题如下:
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at redis.clients.util.Pool.getResource(Pool.java:50) at redis.clients.jedis.JedisPool.getResource(JedisPool.java:86) at cn.itheima.redis.JedisTest.testJedisPool(JedisTest.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:292) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out at redis.clients.jedis.Connection.connect(Connection.java:154) at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:83) at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1643) at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:85) at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:861) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363) at redis.clients.util.Pool.getResource(Pool.java:48) ... 25 moreCaused by: java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at redis.clients.jedis.Connection.connect(Connection.java:148) ... 32 more
关闭VMware防火墙:
# service firewalld stop
关闭centos7的防火墙:
# systemctl stop firewalld.service #停止firewall## systemctl disable firewalld.service #禁止firewall开机启动# # firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
阅读全文
0 0
- Jedis测试异常:connect timed out
- CenterOS7安装Redis,测试 Jedis 连接超时(connect timed out)
- Jedis远程链接报错(connect timed out)
- Java Jedis远程连接redis异常解决思路,异常描述:Could not get a resource from the pool && connect timed out
- Connection timed out: connect
- Connection timed out: connect
- Connection timed out: connect
- Android Studio Error:Connection timed out: connect.异常
- JMeter测试问题java.net.SocketTimeoutException: connect timed out,Read timed out
- Jedis连接linux下redis服务器连接超时connect timed out解决
- Connection timed out: connect 解决方法
- Error:Connection timed out: connect
- Error:Connection timed out: connect.
- Error:Connection timed out:connect.
- Connection timed out: connect 解决办法
- Dom4J读取XML文件时出现的connection timed out:connect Nested exception异常解决方法
- SFTP连接异常 Could not connect to SFTP server. Connection timed out
- GCM google云推送异常 java.net.ConnectException: Connection timed out: connect
- 体验RxJava和lambda
- java.lang.NoSuchMethodError: org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl.getTrList(
- SpringMVC中不能只使用@Controller而不用@RequestMapping
- C# ListView用法详解
- 设计模式简介
- Jedis测试异常:connect timed out
- ACE的Task框架
- 第一个Tensorflow程序
- 带你玩转Visual Studio——带你高效开发--番茄助手使用
- Ubuntu分区小知识与分区方案
- Android 快速开发(一),封装一个 TopBarBaseActivity
- Directx11教程四十二下之进行骨骼动画的渲染
- 关于诚实
- notifyDataSetChanged()无效原因