1

the exception my project throws is below .

enter image description here

and i check my redis server to show client status , i find that .

enter image description here

the spring config is that

    <bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig" >
         <property name="maxIdle" value="10" />
         <property name="maxTotal" value="20" />
         <property name="testOnBorrow" value="true" />
         <property name="maxWaitMillis" value="6000" />
    </bean>


    <bean id="connectionFactory"
    class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
        p:host-name="192.168.5.52" p:port="6380" p:password="szwgmf"
        p:pool-config-ref="poolConfig" 
        p:database="3"/>
<bean id="stringSerializer"
    class="org.springframework.data.redis.serializer.StringRedisSerializer" />

<bean id="redisTemplate"     class="org.springframework.data.redis.core.RedisTemplate">
        <property name="connectionFactory" ref="connectionFactory" />
        <property name="keySerializer" ref="stringSerializer" />
        <property name="valueSerializer" ref="stringSerializer" />
        <property name="enableTransactionSupport" value="true" />
    </bean>

the pom.xml is

<dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>1.6.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.8.1</version>
        </dependency>
Pierre.Vriens
  • 2,117
  • 75
  • 29
  • 42
raser
  • 11
  • 3
  • 1
    please add `stackTrace` of errord instead of tagging Images. @raser – Vikrant Kashyap Apr 05 '16 at 03:26
  • That's a pooling issue, see here: http://stackoverflow.com/questions/20401254/i-am-getting-pool-error-timeout-waiting-for-idle-object – mp911de Apr 05 '16 at 06:24
  • thanks for your comments. yes,it seems to bo a pooling issue ,but i think spring-data-redis will take care of connections .there are two things happened that i cannot explain that: – raser Apr 06 '16 at 01:11
  • 1.when my project open ten connections , In the next short period of time ,it works well, but after A few minutes ,those connections ,cannot be got by project , the project create new connection to handle request instead of use connections,but in redis server still can see the old connections . 2 once the request amount more the max connection of the config, the problem happened ,even thought only one request. – raser Apr 06 '16 at 01:24

0 Answers0