lucene: IO/FileNotFoundException:(Too many open files) 查询异常解决



try {
IndexReader indexReader = indexSearcher.getIndexReader();
indexReader.close();
indexReader = null;
indexSearcher.close();
indexSearcher = null;
} catch (IOException e) {
e.printStackTrace();
}
}
以后出现这种问题首先仔细检查自己写的代码打开文件是不是没有正确关闭,程序的话就是这种错误,不是的话,就是系统的原因,加大文件句柄打开数量解决
IndexReader indexReader = IndexReader.open(dir, true);
dir.close();
* 先获取reader,如果索引文件已经变化,关闭当前indexSearcher,然后以重新获取的indexReader
* 作为参数new一个新的indexSearcher实例
*/
IndexReader indexReader=indexSearcher.getIndexReader();//获取当前的indexReader
if(!indexReader.isCurrent()){//判断是否有索引更新
// 如果有索引更新,先关闭当前的indexSearcher
indexSearcher.close();
//利用indexReader.reopen()获取新的indexReader,并作为IndexSearcher的参数创建一个新的indexSearcher
indexSearcher=new IndexSearcher(indexReader.reopen());
}
lucene: IO/FileNotFoundException:(Too many open files) 查询异常解决的更多相关文章
- java.io.FileNotFoundException: ***(Too many open files)
http://yizhilong28.iteye.com/blog/1154098 在linux下跑一个多线程读取文件的程序,待读取文件有数十万个.程序读取过程中抛出如下异常*****(Too man ...
- lucene: nDocs must be > 0查询异常解决
nDocs must be > 0 // 函数search(query,filter,n),其中query是查询条件,filter是过滤器,n查询数量,异常消息意思就是n参数的值必须大于 ...
- “System.IO.FileNotFoundException”类型的未经处理的异常在 mscorlib.dll 中发生
这个错误是我在打包的时候.发现的,由于我移动了我的project的位置(从C盘移动到了D盘),看一下出错的代码: Dim strDB As String = System.Configuration. ...
- 报错:java.io.FileNotFoundException: (系统找不到指定的路径。)
报错如下: java.io.FileNotFoundException: E:\apache-tomcat-8.0.37\webapps\20161028-FileUpLoad\WEB-INF\fil ...
- nested exception is java.io.FileNotFoundException: class path resource [spring/spring-datasource-mog
spring单元測试时发现的问题: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsin ...
- Caused by: java.io.FileNotFoundException
1.错误描述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help ...
- cloudera-scm-server启动时出现Caused by: java.io.FileNotFoundException: /var/lib/cloudera-scm-server/.keystore (No such file or directory)问题解决方法(图文详解)
不多说,直接上干货! 问题详情 查看/var/log/cloudera-scm-server.log的启动日志 问题来源 我在用cloudermanager安装好之后,然后,在对如下. 配置kerbe ...
- SpringBoot 上传文件到linux服务器 异常java.io.FileNotFoundException: /tmp/tomcat.50898……解决方案
SpringBoot 上传文件到linux服务器报错java.io.FileNotFoundException: /tmp/tomcat.50898-- 报错原因: 解决方法 java.io.IOEx ...
- 服务 在初始化安装时发生异常:System.IO.FileNotFoundException: "file:///D:\testService"未能加载文件或程序集。系统找不到指定文件。
@echo.@if exist "%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" goto INSTALL ...
随机推荐
- 浙江省第十二届省赛 Beauty of Array(思维题)
Description Edward has an array A with N integers. He defines the beauty of an array as the summatio ...
- scrapy snippet
1. spider文件 from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors. ...
- (22)python 自动化
例子 from selenium import webdriver driver = webdriver.PhantomJS() driver.get("http://www.huhumh. ...
- 16、Django实战第16天:优化url
今天完成的是一个优化url.... 前面我们所有的url都是配置在一个mxonline.urls.py中.因为我们根据项目实际情况配置了多个app,那么我们相应的url是可以配置在自己的app中的,这 ...
- 【bzoj1370】【团伙】原来并查集还能这么用?!
(画师当然是武内崇啦) Description 在某城市里住着n个人,任何两个认识的人不是朋友就是敌人,而且满足: 1. 我朋友的朋友是我的朋友: 2. 我敌人的敌人是我的朋友: 所有是朋友的人组成一 ...
- [OpenJudge90][序列DP+乱搞]滑雪
滑雪 总时间限制: 1000ms 内存限制: 65536kB [描述] Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激.可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次 ...
- linux 处理两个文件的并集,交集,计数
1. 取出两个文件的并集(重复的行只保留一份) cat file1 file2 | sort | uniq 2. 取出两个文件的交集(只留下同时存在于两个文件中的文件) cat file1 file2 ...
- 51单片机软件I2C驱动中的CY
做一个MSP430的项目,虽然430内部有硬件I2C的模块,略难,准备直接移植51的..碰到一句代码 dat <<= 1; //移出数据的最高位 pSDA = CY; //送数据口 dig ...
- Linux下使用split按行数进行切割
说明:一般来说split按行数切割多数用在日志文件上. 实例: 将一个大文件分成若干个小文件方法: 例如将一个BLM.txt文件分成前缀为BLM_ 的1000个小文件,后缀为系数形式,且后缀为4位数字 ...
- CentOS 6.9系统时间和硬件时间设置(转)
总结一下hwclock,这个容易晕: 1)/etc/sysconfig/clock 文件,只对 hwclock 命令有效,且只在系统启动和关闭的时候才有用(修改了其中的 UTC=true 到 UTC= ...