Hello All,
I'm upgrading my current jedis library from 2.9.0 to 4.3.1 and I'm facing an issue which is preventing me from creating jar using gradle command.
Description -
Earlier with Jedis 2.9.0, we were using following configuration while creating the connection:
Set<HostAndPort> connectionPoints = new HashSet<HostAndPort>();<Setting hosts and ports>
final JedisPoolConfig poolConfig = new JedisPoolConfig();
<setting some configs for poolConfig>
JedisCluster cluster= new JedisCluster(connectionPoints, poolConfig);
But in Jedis 4.3.1, since there is no constructor for
JedisPoolConfig, I had to create the object for GenericObjectPoolConfig as below:
final GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
<setting some configs for poolConfig>
JedisCluster cluster= new JedisCluster(connectionPoints, poolConfig);
And everything was working as expected on local, it was fetching the result from staging server correctly and even handling load as well
But when I tried building the project using gradle command (gradlew clean build) it gave me below error -
error: no suitable constructor found for JedisCluster(Set<HostAndPort>,GenericObjectPoolConfig)
JedisCluster cluster= new JedisCluster(connectionPoints, poolConfig);
constructor JedisCluster.JedisCluster(HostAndPort,int) is not applicable
(argument mismatch; Set<HostAndPort> cannot be converted to HostAndPort)
constructor JedisCluster.JedisCluster(HostAndPort,GenericObjectPoolConfig<Connection>) is not applicable
(argument mismatch; Set<HostAndPort> cannot be converted to HostAndPort)
constructor JedisCluster.JedisCluster(Set<HostAndPort>,int) is not applicable
(argument mismatch; GenericObjectPoolConfig cannot be converted to int)
constructor JedisCluster.JedisCluster(Set<HostAndPort>,GenericObjectPoolConfig<Connection>) is not applicable
(argument mismatch; GenericObjectPoolConfig cannot be converted to GenericObjectPoolConfig<Connection>)
constructor JedisCluster.JedisCluster(Set<HostAndPort>,JedisClientConfig) is not applicable
(argument mismatch; GenericObjectPoolConfig cannot be converted to JedisClientConfig)
I know the constructor is not available of same type but somehow it was working fine on local then why it is giving issue while creating the build. Please correct me if I'm making any mistake.
Thanks