Solve the test times redis cluster “Java. Lang. A NumberFormatException: For input string:” 7003 @ 17003… 7002@17002″ 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… 7002@17002″, details of the log are as follows:
Exception in thread "main" java.lang.NumberFormatException: For input string: "7003@17003"
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:
- Error: java.lang.NumberFormatException : multiple points
- java.lang.NoSuchMethodError: org.json.JSONObject.put(Java/lang/String; Java/util/Collection;) “209151;”
- Solve the problem that the local flow of the nifi node is inconsistent with the cluster flow, resulting in the failure to join the cluster
- build.gradle Warming: cannot be applied to ‘(groovy.lang.Closure)’/'(java.lang.String)’
- Redis cli create creates an error when creating a cluster
- [Solved] Flowable Start Error: ClassCastException: java.time.LocalDateTime cannot be cast to java.lang.String
- The local program cannot access the test environment redis cluster through public IP_ compromise
- com.alibaba.fastjson .JSONException: For input string: “3000-01-01” or “9999-12-31”
- Redis cluster error: (error) moved solution
- Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;
- Error in idea compilation: java.lang.OutOfMemoryError Java heap space and java.lang.StackOverflowError
- Mybatis error,There is no getter for property named ‘xx’ in ‘class java.lang.String The solution
- Solve the problem that data cannot be input in idea console
- [Solved] Redis Error: org.springframework.data.redis.RedisConnectionFailureExceptionjava.net.SocketTimeoutException
- To solve the problem of repeated password input when operating sourcetree on MAC
- When setting up etcd cluster, an error is reported. Etcd: request cluster ID mismatch error resolution is only applicable to new etcd cluster or no data cluster
- Solve the problem of “wireless network activation failure” in Ubuntu 18, and repeatedly pop up the password input interface
- Solve the problem of error: cannot pass objects of non trivially copyable type ‘STD:: String’ in C / C + +
- How to solve the problem of string to CString garbled code?
- CMD input Java error could not create the Java virtual machine