我是靠谱客的博主 粗心蜜蜂,这篇文章主要介绍'redis.clients.jedis.JedisPool' that could not be found,现在分享给大家,希望可以做个参考。

***************************
APPLICATION FAILED TO START
***************************

Description:

Field jedisPool in com.jcn.redis.service.RedisService required a bean of type 'redis.clients.jedis.JedisPool' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'redis.clients.jedis.JedisPool' in your configuration.

改成这样:

@Configuration
@Service
public class RedisService extends CachingConfigurerSupport{

    Logger logger = LoggerFactory.getLogger(RedisService.class);

    @Value("${redis.host}")
    private String host;

    @Value("${redis.port}")
    private int port;

    @Value("${redis.timeout}")
    private int timeout;

    @Bean
    public JedisPool redisPoolFactory() {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout, null);
        return jedisPool;
    }

 

配置信息:

#Redis服务器地址
redis.host=localhost
#Redis服务器连接端口
redis.port=6379
#连接超时时间(毫秒)
redis.timeout=10
#Redis服务器连接密码(默认为空)
#redis.password=12345
#最大活动对象数
redis.poolMaxTotal=1000
#连接池中的最大空闲连接
redis.poolMaxIdle=500
#连接池最大阻塞等待时间(使用负值表示没有限制)
redis.poolMaxWait=500

最后

以上就是粗心蜜蜂最近收集整理的关于'redis.clients.jedis.JedisPool' that could not be found的全部内容,更多相关'redis.clients.jedis.JedisPool'内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(169)

评论列表共有 0 条评论

立即
投稿
返回
顶部