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 ...
随机推荐
- <松本行弘的程序世界> 读书笔记
第一章 编程语言不是从安全性的角度考虑以减少程序员犯错误,而是在程序员自己负责的前提下为他提供最大限度发挥能力的灵活性. 第二章 根据对象的不同类型而进行适当的处理,就是多态性的基本内容.根据数据类型 ...
- Unity中Instantiate物体失效问题
才开始学Unity,开始总是这样用Instantiate函数: GameObject temp = (GameObject)Instantiate(bulletSource, transform.po ...
- Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes
http://blog.csdn.net/xx326664162/article/details/51859106 总算有个靠谱的了
- HDU 6208 The Dominator of Strings【AC自动机/kmp/Sunday算法】
Problem Description Here you have a set of strings. A dominator is a string of the set dominating al ...
- order by 中利用 case when 排序
order by case when a.ShopNumber in(1,2,3) then 0 else 1 end
- 谜题8:Dos Equis
这个谜题将测试你对条件操作符的掌握程度,这个操作符有一个更广为人知的名字:问号冒号操作符.下面的程序将会打印出什么呢? public class DosEquis{ public static voi ...
- 【后缀数组】【线段树】poj3974 Palindrome
考虑奇数长度的回文,对于字符串上的每个位置i,如果知道从i开始的后缀和到i为止的前缀反转后的字符串的lcp长度的话,也就知道了以第i个字符为对称中心的最长回文的长度了.因此,我们用在S中不会出现的字符 ...
- python3中的range函数
奇怪的现象 在paython3中 print(range(10)) 得出的结果是 range(0,10) ,而不是[0,1,2,3,4,5,6,7,8,9] ,为什么呢? 官网原话: In many ...
- 使用GIT进行源码管理 —— VisualStudio官方GIT教程
我之前在文章使用GIT进行源码管理 —— 在VisualStudio中使用GIT中简单的介绍了一下如何使用VS中自带的Git工具,今天发现MSDN上现在也有了非常完整的教程,感兴趣的朋友可以看一下: ...
- Setting an appropriate geodatabase spatial domain
原文地址:http://webhelp.esri.com/arcgisdesktop/9.1/body.cfm?tocVisable=1&ID=1470&TopicName=Setti ...