21:26:57.399 [http--8085-12$481214696] ERROR com.guagua.common.filters.ExceptionFilter 81 - Request processing failed; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894) ~[FrameworkServlet.class:3.1.0.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:779) ~[FrameworkServlet.class:3.1.0.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:114) ~[jsdk-15.jar:3.0.1]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92) ~[jsdk-15.jar:3.0.1]
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103) ~[resin.jar:3.1.0]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:89) ~[CharacterEncodingFilter.class:3.1.0.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) ~[OncePerRequestFilter.class:3.1.0.RELEASE]
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:88) ~[resin.jar:3.1.0]
at com.guagua.common.filters.ExceptionFilter.doFilter(ExceptionFilter.java:47) ~[ExceptionFilter.class:na]
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:88) ~[resin.jar:3.1.0]
at com.guagua.base.ThreadContent.doFilter(ThreadContent.java:158) ~[ThreadContent.class:na]
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:88) ~[resin.jar:3.1.0]
at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:192) [pro.jar:3.1.0]
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187) [resin.jar:3.1.0]
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265) [resin.jar:3.1.0]
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273) [resin.jar:3.1.0]
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682) [resin.jar:3.1.0]
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743) [resin-util.jar:3.1.0]
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662) [resin-util.jar:3.1.0]
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_29]
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at redis.clients.util.Pool.getResource(Pool.java:22) ~[Pool.class:na]
at com.guagua.admin.interfaces.ReadingAreaController.getPopularityTop(ReadingAreaController.java:80) ~[classes:na]
at com.guagua.admin.interfaces.ReadingAreaController.getPopularityTopByWeek(ReadingAreaController.java:62) ~[classes:na]
at sun.reflect.GeneratedMethodAccessor922.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_29]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) ~[HandlerMethodInvoker.class:3.1.0.RELEASE]
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436) ~[AnnotationMethodHandlerAdapter.class:3.1.0.RELEASE]
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424) ~[AnnotationMethodHandlerAdapter.class:3.1.0.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900) ~[DispatcherServlet.class:3.1.0.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827) ~[DispatcherServlet.class:3.1.0.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) ~[FrameworkServlet.class:3.1.0.RELEASE]
... 19 common frames omitted
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1174) ~[GenericObjectPool.class:1.6]
at redis.clients.util.Pool.getResource(Pool.java:20) ~[Pool.class:na]
... 30 common frames omitted
请各位大侠帮忙看看是什么原因造成的?
程序中使用了redis缓存,redis中的缓冲池有1000个链接,程序中都进行了关闭链接的操作。不知道什么原因造成了,以上问题。求解!!!!!
3 个解决方案
#1
无法获取资源池
你是不是有个类型初始绑定有问题?
你是不是有个类型初始绑定有问题?
#2
结贴吧
#3
1、产生原因:客户端去redis服务器拿连接(代码描述的是租用对象borrowObject)的时候,池中无可用连接,即池中所有连接被占用,且在等待时候设定的超时时间后还没拿到时,报出此异常。
2、解决办法:调整JedisPoolConfig中maxActive为适合自己系统的阀值。
<bean id="dataJedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxActive" value="300"/>
<property name="maxIdle" value="100"/>
<property name="maxWait" value="10000"/>
<property name="testOnBorrow" value="true"/>
</bean>
详细见本人博客:http://blog.csdn.net/jobjava/article/details/12843311
2、解决办法:调整JedisPoolConfig中maxActive为适合自己系统的阀值。
<bean id="dataJedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxActive" value="300"/>
<property name="maxIdle" value="100"/>
<property name="maxWait" value="10000"/>
<property name="testOnBorrow" value="true"/>
</bean>
详细见本人博客:http://blog.csdn.net/jobjava/article/details/12843311
#1
无法获取资源池
你是不是有个类型初始绑定有问题?
你是不是有个类型初始绑定有问题?
#2
结贴吧
#3
1、产生原因:客户端去redis服务器拿连接(代码描述的是租用对象borrowObject)的时候,池中无可用连接,即池中所有连接被占用,且在等待时候设定的超时时间后还没拿到时,报出此异常。
2、解决办法:调整JedisPoolConfig中maxActive为适合自己系统的阀值。
<bean id="dataJedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxActive" value="300"/>
<property name="maxIdle" value="100"/>
<property name="maxWait" value="10000"/>
<property name="testOnBorrow" value="true"/>
</bean>
详细见本人博客:http://blog.csdn.net/jobjava/article/details/12843311
2、解决办法:调整JedisPoolConfig中maxActive为适合自己系统的阀值。
<bean id="dataJedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxActive" value="300"/>
<property name="maxIdle" value="100"/>
<property name="maxWait" value="10000"/>
<property name="testOnBorrow" value="true"/>
</bean>
详细见本人博客:http://blog.csdn.net/jobjava/article/details/12843311