扯淡的bug--redis

来源:互联网 发布:java默认访问修饰符 编辑:程序博客网 时间:2024/05/17 22:42
2017-06-24 18:10:30,077 ERROR [][][com.mg.web.common.service.impl.BaseService] - <ActivityServiceImpl getChristmasUser method error:>redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool        at redis.clients.util.Pool.getResource(Pool.java:50)        at redis.clients.jedis.JedisPool.getResource(JedisPool.java:88)        at com.xx.x.xx.service.impl.xxx.getUserInfoByNumForCache(xx.java:258)        at com.mg.web.friend.service.impl.UserInfoServiceImpl$$FastClassBySpringCGLIB$$f6193c36.invoke(<generated>)        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:718)        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:654)        at com.mg.web.friend.service.impl.UserInfoServiceImpl$$EnhancerBySpringCGLIB$$f14b4cfa.getUserInfoByNumForCache(<generated>)        at com.xx.xx.xx.xx.UserInfoController.toUserInfoDetailPage(xx.java:599)        at sun.reflect.GeneratedMethodAccessor382.invoke(Unknown Source)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)        at java.lang.reflect.Method.invoke(Method.java:498)        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)        at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)

今天线上的项目报了这个错误,再重启了tomcat之后又恢复了,但是运行不久又出现了,google了一下查不出原因,偶然看到一个回答另外一个异常的,说是不是因为jedis用完之后没有回收资源,连接池资源全部被占用了导致取不出资源,检查了一下项目结果真的有几处使用了jedis之后没有回收,改了之后就好了

原创粉丝点击