netbean+mysql+Tomcat, run project后IE报Cannot create PoolableConnectionFactory,像是数据库拒绝连接,咋办?
netbean+mysql+Tomcat, run project后IE报org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create Poolable Connection Factory (Communications link failure due to underlying exception:
看起来像是数据库拒绝连接,IE详细报错如下:
ERROR!
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connect
STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection refused: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:276)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666)
at com.mysql.jdbc.Connection.(Connection.java:1531)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.borrowsys.db.ConnectionManager.getConnection(ConnectionManager.java:38)
at com.borrowsys.db.Worker.getAllItems(Worker.java:56)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:94)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.(HttpServlet.java:803)
at orre.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at orre.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
at orre.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at orre.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at orre.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at orre.StandardContextValve.invoke(StandardContextValve.java:175)
at orre.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at orre.StandardEngineValve.invoke(StandardEngineValve.java:109)
at ornnector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at oryote.(Http11Processor.java:844)
at oryote.$Http11ConnectionHandler.process(Http11Protocol.java:581)