When running a Spring Boot application that accesses a Redis server, you might encounter the following errors:
Or:
Or:
Environment
Spring Boot 2.x or 3.x
Redis 6.x or 7.x
Code
Project Dependencies
We use Maven for dependency management. Below is the pom.xml configuration:
Redis Configuration Class
Spring Boot requires a connection factory and a Redis template:
Testing Redis Connection
Reason
Solution
Modify your pom.xml to exclude Lettuce and explicitly include the correct Jedis version:
After making this change, rerun your application, and the issue should be resolved.
Summary
The ‘JedisPoolConfig not found’ and ‘JedisShardInfo not found’ exceptions occur due to Spring Boot’s default usage of Lettuce instead of Jedis. If you want to use Jedis, you must explicitly exclude Lettuce and ensure you use a compatible Jedis version. Upgrading to jedis-5.0.0 resolves the dependency conflict.
Final Words + More Resources
My intention with this article was to help others who might be considering solving such a problem.
So I hope that’s been the case here. If you still have any questions, don’t hesitate to ask me by
email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope: