我們有一個運行在Tomcat7和MySQL5數據庫中的Struts2 web應用程序。再次如何解決java.net.SocketException消息:打開的文件太多
java.net.SocketException: Too many open files
如果我們重新啓動Tomcat,它工作了一段時間,然後將問題重生:在網站上瀏覽了一下之後,我們得到了異常。
有人能幫我解決這個問題嗎?
堆棧跟蹤:
java.net.SocketException: Too many open files
at java.net.Socket.createImpl(Socket.java:387)
at java.net.Socket.<init>(Socket.java:361)
at java.net.Socket.<init>(Socket.java:208)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1185)
at org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:79)
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)