8

我自己编写代码来索引一些数据文件。一切正常。一旦我修改了schema.xml文件,现在我得到内部服务器错误,我不知道如何解释它。

Internal Server Error

request: http://127.0.0.1:8080/solr/update?wt=javabin&version=2
    at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:427)
    at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:249)
    at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
    at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:69)
    at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:54)
    at solr.client.SolrClient.index(SolrClient.java:109)
    at solr.client.SolrClient.main(SolrClient.java:26)

然后我查看了 catalina 日志文件,它说没有创建核心......

   Jun 26, 2012 2:09:21 AM org.apache.solr.core.SolrCore close
INFO: []  CLOSING SolrCore org.apache.solr.core.SolrCore@5675b3ee
Jun 26, 2012 2:09:21 AM org.apache.solr.common.SolrException log
SEVERE: java.lang.NullPointerException
    at org.apache.solr.core.SolrCore.close(SolrCore.java:712)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:599)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:483)
    at org.apache.solr.core.CoreContainer.load(CoreContainer.java:335)
    at org.apache.solr.core.CoreContainer.load(CoreContainer.java:219)
    at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:161)
    at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)

Jun 26, 2012 2:09:21 AM org.apache.solr.core.SolrCore closeSearcher
INFO: [] Closing main searcher on request.
Jun 26, 2012 2:09:21 AM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:600)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:483)
    at org.apache.solr.core.CoreContainer.load(CoreContainer.java:335)
    at org.apache.solr.core.CoreContainer.load(CoreContainer.java:219)
    at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:161)
    at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.RuntimeException: org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.NIOFSDirectory@/Users/nan/solr-tomcat/solr/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@11396ef7: files: []
    at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1104)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:585)
    ... 23 more
Caused by: org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.NIOFSDirectory@/Users/nan/solr-tomcat/solr/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@11396ef7: files: []
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:667)
    at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:72)
    at org.apache.lucene.index.IndexReader.open(IndexReader.java:375)
    at org.apache.solr.core.StandardIndexReaderFactory.newReader(StandardIndexReaderFactory.java:38)
    at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1093)
    ... 24 more

更新了上面的 catalina 日志文件...是的,我删除了索引数据,因为我认为我要创建新索引...我今天早些时候这样做了,但直到现在我才看到这种错误...我应该如何解决这个问题? :(

非常感谢!!!(^不定式)

4

3 回答 3

22

正如您从日志文件中看到的那样,Solr/Lucene 在数据目录中找不到段文件。

如果您删除数据目录,Solr 将在启动时自动重新创建一个全新的索引(当然是空的)。从错误看来,您的数据目录在那里,但缺少一些文件。由于我了解您愿意重新索引所有内容,因此您只需删除索引目录然后重新索引即可修复错误。

于 2012-06-26T10:44:03.470 回答
2

异常IndexNotFoundException表示在目录中未找到索引。可能是因为目录是空的,但也可能表明索引损坏。

所以你应该:

  1. 删除index目录或从备份中恢复数据。
  2. 重新启动服务器(或至少重新加载配置)。
于 2015-04-08T14:01:24.857 回答
0

我遇到了这个错误,因为还没有要搜索的文档(这发生在我的工作站上)。

在这种情况下,触发创建文档将解决问题。

于 2021-08-09T19:45:28.153 回答