java.net.SocketException too many open files

下面是错误信息:
2013-6-3 11:10:52 org.apache.http.impl.client.DefaultRequestDirector tryConnect
信息: I/O exception (java.net.SocketException) caught when connecting to the target host: Too many open files
2013-6-3 11:10:52 org.apache.http.impl.client.DefaultRequestDirector tryConnect
信息: Retrying connect
java.net.SocketException: Too many open files
at java.net.Socket.createImpl(Socket.java:397)
at java.net.Socket.getImpl(Socket.java:460)
at java.net.Socket.setSoTimeout(Socket.java:1017)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:126)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at org.whu.weibo.util.NextPage.getPage(NextPage.java:48)
at org.whu.weibo.content.NTESweibo.crawler(NTESweibo.java:42)
at org.whu.Scan.scanByPage(Scan.java:27)
at org.whu.Scan.run(Scan.java:17)
at java.lang.Thread.run(Thread.java:662)

suannai0314
鹳狸媛 楼主的这个问题解决了么?下边的答案能解决问题么?如果可以麻烦点击答案旁的√采纳哦~如果没有也可以将自己的答案贴上然后进行采纳的。
接近 7 年之前 回复

2个回答

看异常,java.net.SocketException: Too many open files 你打开的文件太多,少开几个几个文件试试

bulls33
csmijo 谢谢,我查了一些文档也是说打开的文件太多,已修改,目前还没有出错,不敢确定。因为我也是在程序跑了一个月后出现的问题,所以还在观察。
接近 7 年之前 回复

连接数过多,是否socket未正常关闭

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐