maven项目中使用redis集群报错: java.lang.NumberFormatException: For input string: "7006@17006"

Posted 込戲冭氵罙

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven项目中使用redis集群报错: java.lang.NumberFormatException: For input string: "7006@17006"相关的知识,希望对你有一定的参考价值。

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [redis.clients.jedis.JedisCluster]: Constructor threw exception; nested exception is java.lang.NumberFormatException: For input string: "7006@17006"

at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:267)

... 65 more

Caused by: java.lang.NumberFormatException: For input string: "7006@17006"

at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

 

 

解决:由于redis集群的采用的版本是4.1的,在maven的pom.xml中将jedis的版本改成2.9的就可以了,

    <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.9.0</version>
    </dependency>

 

以上是关于maven项目中使用redis集群报错: java.lang.NumberFormatException: For input string: "7006@17006"的主要内容,如果未能解决你的问题,请参考以下文章

遇到问题--java--新建maven项目打jar包缺少第三方引入的包maven dependencies报错Caused by: java.lang.ClassNotFoundException

遇到问题--java--新建maven项目打jar包缺少第三方引入的包maven dependencies报错Caused by: java.lang.ClassNotFoundException

遇到问题--java--新建maven项目打jar包缺少第三方引入的包maven dependencies报错Caused by: java.lang.ClassNotFoundException

java代码怎么正则删除redis的数据

使用Redis存储Nginx+Tomcat负载均衡集群的Session

Redis笔记整理:Java API使用与Redis分布式集群环境搭建