SolrException:打开新搜索器时出错

SolrException: Error opening new searcher

我的电脑上安装了 Solr,直到昨天它都运行良好。当我启动它时,每个核心都会出现 SolrCore Initialization Failures。错误是

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error opening new searcher

这是完整的堆栈跟踪:

org.apache.solr.common.SolrException: Error opening new searcher
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:885)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:652)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:518)
at org.apache.solr.core.CoreContainer.call(CoreContainer.java:283)
at org.apache.solr.core.CoreContainer.call(CoreContainer.java:277)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Error opening new searcher
at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1577)
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1689)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:857)
... 8 more
Caused by: java.io.IOException: Unable to unmap the mapped buffer: MMapIndexInput(path="D:\solr-5.1.0\solr-5.1.0\server\solr\kofax_fxm_master\data\index\segments_2b")
at org.apache.lucene.store.MMapDirectory.freeBuffer(MMapDirectory.java:301)
at org.apache.lucene.store.ByteBufferIndexInput.freeBuffer(ByteBufferIndexInput.java:378)
at org.apache.lucene.store.ByteBufferIndexInput.close(ByteBufferIndexInput.java:357)
at org.apache.lucene.store.BufferedChecksumIndexInput.close(BufferedChecksumIndexInput.java:60)
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:413)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:826)
at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:78)
at org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:65)
at org.apache.solr.update.DefaultSolrCoreState.createMainIndexWriter(DefaultSolrCoreState.java:273)
at org.apache.solr.update.DefaultSolrCoreState.getIndexWriter(DefaultSolrCoreState.java:116)
at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1546)
... 10 more
Caused by: java.lang.IllegalAccessException: class org.apache.lucene.store.MMapDirectory cannot access class jdk.internal.ref.Cleaner (in module java.base) because module java.base does not export jdk.internal.ref to unnamed module @2c718865
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Unknown Source)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.lucene.store.MMapDirectory.run(MMapDirectory.java:294)
at org.apache.lucene.store.MMapDirectory.run(MMapDirectory.java:286)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.apache.lucene.store.MMapDirectory.freeBuffer(MMapDirectory.java:286)
... 20 more

我尝试删除所有核心并重新开始,我清除并重新安装 solr,但错误仍然存​​在。

当您 运行 的 Java 版本错误时,就会发生这种情况。我从你的错误中看到你使用的是 5.1,但你的笔记说你是 java 的第 9 版,如果你将其回滚到 8 将解决问题。