Spring-data-redis集成提交数据出现'maxActive'和‘maxWaitMillis’错误

使用Spring集成的redis在提交数据到redis时出现Invalid property ‘maxWait’ of bean class [Redis.clients.jedis.JedisPoolConfig]: Bean property ‘maxWait’ is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
从字面上来看是maxWait这个属性不存在或者是没有getter和setter方法,但是Spring的集成肯定是实现了这两个方法,经过排除那么就是maxWait不存在,通过查询Spring-data-redis的官网,发现高版本SDR的maxWait属性和maxActive属性已经修改成MaxWaitMillis和maxTotal。
所以在redis的配置文件中把属性修改成下面的形式:

id="poolConfig" class="redis.clients.jedis.JedisPoolConfig"><property name="maxIdle" value="${redis.maxIdle}" /><property name="maxTotal" value="${redis.maxTotal}" /><property name="maxWaitMillis" value="${redis.maxWaitMillis}" /><property name="testOnBorrow" value="${redis.testOnBorrow}" />

再次测试向redis中写入文件,成功!


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部