error messages:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
Exception in thread "main"redis.clients.jedis.exceptions.JedisConnectionException: Failed to create socket.
java.net.SocketTimeoutException: connect timed out
Reason: Unable to load class “org . slf4j . impl . staticloggerbinder”, no operation (NOP) logger implementation by default, cannot create socket, resulting in connection timeout.
Solution:
Step 1: add import dependency first (because a class cannot be loaded, it means that there is no dependency in the library, so it needs to import dependency)
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.9.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.68.sec10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.0-alpha7</version>
</dependency>
Step 2: Comment out bind 127.0.0.1 on line 69 of the redis.conf configuration file. Commenting out bind 127.0.0.1 means that all client access is available, which is equivalent to bind 0.0.0.0
Step 3: Change yes to no in protected-mode yes on line 88
Step 4: Kill the redis process and restart it
ps -ef |grep redis
kill the redis process port number
redis-server . /xiaoConfig/redis-conf
redis-cli -p 6379
Step 5: Connecting to Redis in idea by manipulating jedis
finally successful:
Read More:
- [Solved] spingboot Error: I/O error on POST request for “9411/api/v2/spans“: connect timed out
- [Solved] Windows Redis Error: Could not create server TCP listening socket 127.0.0.1:6379: bind…
- [Solved] xxl-job Error: xxl-rpc remoting error(connect timed out)
- [Solved] Project Startup Error: Redis health check failed:Unable to connect to localhost6379
- [Solved] Project Startup Error: Redis health check failed: Unable to connect to localhost6379
- [Solved] Redis Client On Error Error connect ECONNREFUSED 11.20.200.6379 Config right
- [Solved] Redis Error: Error condition on socket for SYNC: No route to host
- [Solved] Unable to connect to a as user root com.jcraft.jsch.JSchException: Auth failUnable to connect
- JAVA Connect Redis Error: stop-writes-on-bgsave-error option
- Redis Startup Error: Creating Server TCP listening socket 127.0.0.1:6379: bind: No error
- [Solved] Rocketmq installation error: org.apache.rocketmq.remoting.exception.remotingconnectexception: connect to failed
- Microservice call exceptions: error feign.RetryableException: Read timed out executing POST http://xxx…….
- [Solved] Redis Error: org.springframework.data.redis.RedisConnectionFailureExceptionjava.net.SocketTimeoutException
- How to Solve nacos Startup Error and Connect to MYSQL
- [Solved] Docker-maven-plugin Build Mirror Error: failed: Connection refused: connect
- Redis: DENIED Redis is running in protected mode [How to Solve]
- API Failed to Connect phoenix Error: java.sql.SQLException: ERROR 726 (43M10): Inconsistent namespace mapping properties
- How to Solve IBM MQ Connect Error Code 2035
- How to Solve Docker Portainer Connect Error
- [Errno 14] PYCURL ERROR 7 – “couldn’t connect to host”