Solve the problem of testing redis cluster“ java.lang.NumberFormatException : For input string: “ [email protected]@17002 “And so on

Solve the test times redis cluster “Java. Lang. A NumberFormatException: For input string:” 7003 @ 17003… [email protected]″ and other anomalies…
1. Problem Description:

About redis5.0 cluster mode, through the client test code debugging quote “the Exception in the thread” main “Java. Lang. A NumberFormatException: For input string:” 7003 @ 17003… [email protected]″, details of the log are as follows:

Exception in thread "main" java.lang.NumberFormatException: For input string: "[email protected]"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:492)
    at java.lang.Integer.valueOf(Integer.java:582)
    at redis.clients.util.ClusterNodeInformationParser.getHostAndPortFromNodeLine(ClusterNodeInformationParser.java:40)
    at redis.clients.util.ClusterNodeInformationParser.parse(ClusterNodeInformationParser.java:14)
    at redis.clients.jedis.JedisClusterInfoCache.discoverClusterNodesAndSlots(JedisClusterInfoCache.java:40)
    at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:50)
    at redis.clients.jedis.JedisClusterConnectionHandler.<init>(JedisClusterConnectionHandler.java:31)
    at redis.clients.jedis.JedisSlotBasedConnectionHandler.<init>(JedisSlotBasedConnectionHandler.java:17)
    at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:51)
    at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:35)
    at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:26)
    at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:30)
    at com.xwood.redis.cluster.JedisClusterTest.main(JedisClusterTest.java:23)

2. Solutions
Because of the jedIS-2.7.0.jar version, changing to the Jedis-3.2.0.jar version will solve the problem, because the Redis5.0 version requires a high version driver package for the client.


Read More: