redis没有启动会报什么错???

以下是报错信息,应该是根据项目不同,具体的不太一样,但我们能清晰的看到一句

加红,加大,加粗

Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Failed connecting to host 127.0.0.1:6379

解决办法就是打开redis了。

 

java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)

         at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2385)

         at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2110)

         at org.apache.commons.dbcp2.BasicDataSource.getLogWriter(BasicDataSource.java:1622)

         at org.apache.commons.dbcp2.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:554)

         at com.store.utils.DBCPUtil.<clinit>(DBCPUtil.java:24)

         at com.store.utils.CommonCRUDUtil.query(CommonCRUDUtil.java:61)

         at com.store.dao.impl.ProductDaoImp.findHots(ProductDaoImp.java:18)

         at com.store.service.impl.ProductServiceImp.findHots(ProductServiceImp.java:16)

         at com.store.web.servlet.IndexServlet.execute(IndexServlet.java:31)

         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

         at java.lang.reflect.Method.invoke(Method.java:498)

         at com.store.web.base.BaseServlet.service(BaseServlet.java:34)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)

         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)

         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)

         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)

         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:531)

         at org.apache.jsp.index_jsp._jspService(index_jsp.java:119)

         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:444)

         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)

         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at com.store.web.filter.EncodingFilter.doFilter(EncodingFilter.java:35)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)

         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)

         at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)

         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

         at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)

         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)

         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)

         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

         at java.lang.Thread.run(Thread.java:748)

Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

         at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)

         at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)

         at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:832)

         at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)

         at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)

         at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207)

         at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:53)

         at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:291)

         at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2395)

         at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2381)

         ... 56 more

Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

         at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)

         at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)

         at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)

         at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)

         at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91)

         at com.mysql.cj.NativeSession.connect(NativeSession.java:152)

         at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:952)

         at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:822)

         ... 63 more

Caused by: java.net.ConnectException: Connection refused: connect

         at java.net.DualStackPlainSocketImpl.connect0(Native Method)

         at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

         at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

         at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

         at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

         at java.net.Socket.connect(Socket.java:589)

         at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:173)

         at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65)

         ... 66 more

java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in

         at org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:315)

         at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:345)

         at com.store.utils.CommonCRUDUtil.query(CommonCRUDUtil.java:63)

         at com.store.dao.impl.ProductDaoImp.findHots(ProductDaoImp.java:18)

         at com.store.service.impl.ProductServiceImp.findHots(ProductServiceImp.java:16)

         at com.store.web.servlet.IndexServlet.execute(IndexServlet.java:31)

         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

         at java.lang.reflect.Method.invoke(Method.java:498)

         at com.store.web.base.BaseServlet.service(BaseServlet.java:34)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)

         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)

         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)

         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)

         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:531)

         at org.apache.jsp.index_jsp._jspService(index_jsp.java:119)

         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:444)

         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)

         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at com.store.web.filter.EncodingFilter.doFilter(EncodingFilter.java:35)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)

         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)

         at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)

         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

         at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)

         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)

         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)

         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

         at java.lang.Thread.run(Thread.java:748)

java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in

         at org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:315)

         at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:345)

         at com.store.utils.CommonCRUDUtil.query(CommonCRUDUtil.java:63)

         at com.store.dao.impl.ProductDaoImp.findNews(ProductDaoImp.java:24)

         at com.store.service.impl.ProductServiceImp.findNews(ProductServiceImp.java:21)

         at com.store.web.servlet.IndexServlet.execute(IndexServlet.java:32)

         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

         at java.lang.reflect.Method.invoke(Method.java:498)

         at com.store.web.base.BaseServlet.service(BaseServlet.java:34)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)

         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)

         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)

         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)

         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:531)

         at org.apache.jsp.index_jsp._jspService(index_jsp.java:119)

         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:444)

         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)

         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at com.store.web.filter.EncodingFilter.doFilter(EncodingFilter.java:35)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)

         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)

         at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)

         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

         at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)

         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)

         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)

         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

         at java.lang.Thread.run(Thread.java:748)

java.lang.reflect.InvocationTargetException

         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

         at java.lang.reflect.Method.invoke(Method.java:498)

         at com.store.web.base.BaseServlet.service(BaseServlet.java:34)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at com.store.web.filter.EncodingFilter.doFilter(EncodingFilter.java:35)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)

         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)

         at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)

         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

         at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)

         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)

         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)

         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

         at java.lang.Thread.run(Thread.java:748)

Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

         at redis.clients.jedis.util.Pool.getResource(Pool.java:59)

         at redis.clients.jedis.JedisPool.getResource(JedisPool.java:234)

         at com.store.utils.JedisUtil.getJedis(JedisUtil.java:45)

         at com.store.web.servlet.CategoryServlet.findAllCats(CategoryServlet.java:32)

         ... 31 more

Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Failed connecting to host 127.0.0.1:6379

         at redis.clients.jedis.Connection.connect(Connection.java:204)

         at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:100)

         at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1862)

         at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:117)

         at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:883)

         at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:436)

         at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:365)

         at redis.clients.jedis.util.Pool.getResource(Pool.java:50)

         ... 34 more

Caused by: java.net.ConnectException: Connection refused: connect

         at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)

         at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)

         at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

         at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

         at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

         at java.net.Socket.connect(Socket.java:589)

         at redis.clients.jedis.Connection.connect(Connection.java:181)

         ... 41 more

java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in

         at org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:315)

         at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:345)

         at com.store.utils.CommonCRUDUtil.query(CommonCRUDUtil.java:63)

         at com.store.dao.impl.ProductDaoImp.findHots(ProductDaoImp.java:18)

         at com.store.service.impl.ProductServiceImp.findHots(ProductServiceImp.java:16)

         at com.store.web.servlet.IndexServlet.execute(IndexServlet.java:31)

         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

         at java.lang.reflect.Method.invoke(Method.java:498)

         at com.store.web.base.BaseServlet.service(BaseServlet.java:34)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)

         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)

         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)

         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)

         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:531)

         at org.apache.jsp.index_jsp._jspService(index_jsp.java:119)

         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:444)

         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)

         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at com.store.web.filter.EncodingFilter.doFilter(EncodingFilter.java:35)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)

         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)

         at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)

         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

         at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)

         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)

         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)

         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

         at java.lang.Thread.run(Thread.java:748)

java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in

         at org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:315)

         at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:345)

         at com.store.utils.CommonCRUDUtil.query(CommonCRUDUtil.java:63)

         at com.store.dao.impl.ProductDaoImp.findNews(ProductDaoImp.java:24)

         at com.store.service.impl.ProductServiceImp.findNews(ProductServiceImp.java:21)

         at com.store.web.servlet.IndexServlet.execute(IndexServlet.java:32)

         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

         at java.lang.reflect.Method.invoke(Method.java:498)

         at com.store.web.base.BaseServlet.service(BaseServlet.java:34)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)

         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)

         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)

         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)

         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:531)

         at org.apache.jsp.index_jsp._jspService(index_jsp.java:119)

         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:444)

         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)

         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)

         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at com.store.web.filter.EncodingFilter.doFilter(EncodingFilter.java:35)

         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)

         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)

         at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)

         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

         at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)

         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)

         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)

         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

         at java.lang.Thread.run(Thread.java:748)

posted @ 2019-03-14 23:04  雨中遐想  阅读(13)  评论(0编辑  收藏  举报  来源