由于进程停止导致启动时出现Apache Lucene FileNotFoundException

时间:2016-09-23 15:35:47

标签: java jboss lucene

回答

客户在维护后无法启动应用程序;部署新WAR或简单更新属性。在bean初始化期间启动时,他们将收到以下内容:

Caused by: java.io.FileNotFoundException: /app/app-directory/servers/app-workdir/lucene-index/_3gp1.si (No such file or directory)
at java.io.RandomAccessFile.open(Native Method) [rt.jar:1.7.0_80]
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241) [rt.jar:1.7.0_80]
at org.apache.lucene.store.MMapDirectory.openInput(MMapDirectory.java:193) [lucene-core-4.7.2.jar:4.7.2 1586229 - rmuir - 2014-04-10 09:00:35]
at org.apache.lucene.codecs.lucene46.Lucene46SegmentInfoReader.read(Lucene46SegmentInfoReader.java:49) [lucene-core-4.7.2.jar:4.7.2 1586229 - rmuir - 2014-04-10 09:00:35]
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:340) [lucene-core-4.7.2.jar:4.7.2 1586229 - rmuir - 2014-04-10 09:00:35]
at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:404) [lucene-core-4.7.2.jar:4.7.2 1586229 - rmuir - 2014-04-10 09:00:35]
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:843) [lucene-core-4.7.2.jar:4.7.2 1586229 - rmuir - 2014-04-10 09:00:35]
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:694) [lucene-core-4.7.2.jar:4.7.2 1586229 - rmuir - 2014-04-10 09:00:35]
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:400) [lucene-core-4.7.2.jar:4.7.2 1586229 - rmuir - 2014-04-10 09:00:35]
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:746) [lucene-core-4.7.2.jar:4.7.2 1586229 - rmuir - 2014-04-10 09:00:35]
at proprietary class
at proprietary class
... 50 more

1 个答案:

答案 0 :(得分:0)

确定的根本原因是客户端开发应用程序停止shell脚本的方式,该脚本发出了SIGKILL /“kill -9”,终止了应用程序服务器,而Lucene正在更新索引。

相反,使用SIGTERM /“kill -15”来表示应用程序是我们在内部执行的方式,以及我们如何推荐客户端执行停止。这应该允许Lucene完成任何飞行过程而不会破坏索引。

导致我们这样做的事实是server.log中不存在停止消息

09:10:41,354 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015877: Stopped deployment sqljdbc4.jar (runtime-name: sqljdbc4.jar) in 18998ms
09:10:41,525 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment ojdbc6.jar (runtime-name: ojdbc6.jar) in 19169ms