Skip to content

NoSuchMethod Error redis.clients.jedis.params.SetParams.ex(long) #3161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nicolasb29 opened this issue May 27, 2025 · 3 comments
Open

NoSuchMethod Error redis.clients.jedis.params.SetParams.ex(long) #3161

nicolasb29 opened this issue May 27, 2025 · 3 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@nicolasb29
Copy link

nicolasb29 commented May 27, 2025

Hi,

I have a problem when upgrading from Spring Boot 3.5.0-RC1 (and Spring Boot 3.4.5) to Spring Boot 3.5.0. I made a simple project to demonstrate it. Here is the source code

ValueOperations<String, String> ops = redisTemplate.opsForValue();
return ops.setIfAbsent(key, value, timeout);

When running on the RC1 branch (Spring Boot 3.5.0 RC1), I don't have any errors.

But when I'm running on the main branch (Spring Boot 3.5.0), I have this error:

'redis.clients.jedis.params.BaseSetExParams redis.clients.jedis.params.SetParams.ex(long)'
java.lang.NoSuchMethodError: 'redis.clients.jedis.params.BaseSetExParams redis.clients.jedis.params.SetParams.ex(long)'
	at org.springframework.data.redis.connection.jedis.JedisConverters.toSetCommandExPxArgument(JedisConverters.java:382)
	at org.springframework.data.redis.connection.jedis.JedisStringCommands.set(JedisStringCommands.java:113)
	at org.springframework.data.redis.connection.DefaultedRedisConnection.set(DefaultedRedisConnection.java:355)
	at org.springframework.data.redis.core.DefaultValueOperations.lambda$setIfAbsent$17(DefaultValueOperations.java:249)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:413)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:380)
	at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:117)
	at org.springframework.data.redis.core.DefaultValueOperations.setIfAbsent(DefaultValueOperations.java:249)
	at org.springframework.data.redis.core.ValueOperations.setIfAbsent(ValueOperations.java:154)
	at bzh.bonamy.SetParamspx.RedisService.trySetValue(RedisService.java:22)
	at bzh.bonamy.SetParamspx.RedisServiceTest.testSetIfAbsent(RedisServiceTest.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

Is it a bug? I made something wrong?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 27, 2025
@silpysagartransportexchangegroup

I explicitly put the jedi version to 6.0.0 to fix this issue

@nicolasb29
Copy link
Author

I just saw that the version of Jedis in the 3.5.1-SNAPSHOT is the 6.0.0, and it's working fine.

But why it was working in Milestones and RC of 3.5.0 and not in the final version?
Also upgrade to a major version of Jedis in a patch version of Spring Boot is a best way to do (Jedis 6.x in Spring Boot 3.5.1)?

@silpysagartransportexchangegroup

I think its better to explicitly set the version for now. They will fix it in the next major version release of springboot. Due to this issue they will do next major release ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants