2011-09-10 57 views
0

我工作的Tomcat 7.1,後4.5部署我收到以下錯誤:Tomcat是給錯誤而deployement

SEVERE: Catalina.stop: java.net.SocketException: No buffer space available (maximum connections reached?): connect 

然後,我需要重新啓動我的系統,因爲我的互聯網也停止工作時,這錯誤發生。這個問題是如何引起的?我該如何解決?

我剛剛發現問題,粘貼日誌。請幫幫我。

INFO [http-apr-8080-exec-14] (OrderDAO_MySqlImpl.java:287) - INSIDE THE ORDER DAO IMPL: SUBCAT IS: Cpmuter Services 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 

Last packet sent to the server was 0 ms ago. 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:353) 
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) 
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:2001) 

    at com.mysql.jdbc.Connection.<init>(Connection.java:716) 
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) 
    at sun.reflect.GeneratedConstructorAccessor33.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:353) 
    at com.mysql.jdbc.Connection.getInstance(Connection.java:295) 
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) 

    at java.sql.DriverManager.getConnection(DriverManager.java:582) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at bseller.Order.dao.mysql.OrderDAO_MySqlImpl.getConnection(OrderDAO_MySqlImpl.java:264) 
    at bseller.Order.dao.mysql.OrderDAO_MySqlImpl.getAllOrder(OrderDAO_MySqlImpl.java:294) 
    at bseller.postadd.utils.OrderControlService.getAllOrders(OrderControlService.java:33) 
    at bseller.postadd.utils.OrderManager.PopulateOrderDetail(OrderManager.java:50) 
    at org.apache.jsp.SubCategoryDeails_jsp._jspService(SubCategoryDeails_jsp.java:182) 

    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) 
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) 
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) 

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) 
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593) 
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530) 
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927) 
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:652) 

    at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137) 
    at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177) 
    at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756) 
    at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881) 
    at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473) 
    at org.apache.jsp.Layout_jsp._jspx_meth_tiles_005finsert_005f1(Layout_jsp.java:244) 
    at org.apache.jsp.Layout_jsp._jspService(Layout_jsp.java:137) 

    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) 
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) 
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) 

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) 
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471) 
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402) 
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329) 
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) 

    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274) 
    at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254) 
    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309) 
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) 
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) 
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) 

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) 

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:851) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) 
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:257) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) 

    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1764) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
    at java.lang.Thread.run(Thread.java:619) 
Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect 
    at java.net.PlainSocketImpl.socketConnect(Native Method) 
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) 
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) 
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) 
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) 
    at java.net.Socket.connect(Socket.java:519) 
    at java.net.Socket.connect(Socket.java:469) 
    at java.net.Socket.<init>(Socket.java:366) 
    at java.net.Socket.<init>(Socket.java:209) 
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:168) 
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:262) 
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1926) 
    ... 72 more 
Sep 11, 2011 2:46:24 PM org.apache.catalina.core.ApplicationDispatcher invoke 
SEVERE: Servlet.service() for servlet jsp threw exception 
+0

什麼操作系統發生這種情況? – mmatloka

+0

如果你贏得XP,WIN XP併發連接的限制, – confucius

+0

我使用的是Windows 7 – Pedantic

回答

1

java.net.SocketException: No buffer space available (maximum connections reached?): connect

用簡單的英語,這是操作系統告訴你,由於資源擁塞,它不能創建一個額外的TCP套接字。大多數操作系統對可同時打開多少個連接有嚴格的限制。你有可能達到了這個限制。

爲了避免這樣的問題,數據庫連接通常是合併爲,即不是處理不再需要的連接,而是連接保持在周圍,以用於未來對數據庫的請求。有很多連接池庫。如果您從DataSource映射到JNDI獲得連接,則大多數應用程序服務器也提供池功能。

另一個可能的原因是您使用它們後沒有關閉所有連接。

+0

我檢查了所有。但仍然面臨同樣的問題..謝謝 – Pedantic

1

您的應用程序是否直接使用套接字連接或數據庫?也許你的應用程序創建了很多連接,並沒有關閉它們。

您可以嘗試在cmd中

netstat -a 

進入並分析哪些外國ADDRES出現次數最多的和你知道它 - 檢查它的數據庫地址或某事別人熟悉。

+0

謝謝,但我不明白爲什麼我的系統互聯網連接停止工作... – Pedantic