我是第一次配置 Solr。谷歌几乎没有产生任何洞察力。我看到发布的问题与我的问题相似,但不一样。
我在 ~/solr-home/solr 中有一个名为 collection1 的 SolrCore。我已验证 Solr 在启动时会读取其配置。这是我的核心在 ~solr-home/solr/solr.xml 中的声明:
<cores adminPath="/admin/cores" defaultCoreName="collection1" host="${host:}" hostPort="${jetty.port:}" hostContext="${hostContext:}" zkClientTimeout="${zkClientTimeout:15000}">
<core name="collection1" instanceDir="collection1" />
Solr 在 Ubuntu 上运行。我正在尝试从 Windows 上运行的 Microsoft SQL Server 导入,但我没有建立 JDBC 连接。这是我的数据导入声明:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImporHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
我的核心似乎一开始就开始了。从日志文件:
INFO: Creating SolrCore 'collection1' using instanceDir: solr/collection1
May 09, 2013 2:52:22 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: new SolrResourceLoader for directory: 'solr/collection1/'
May 09, 2013 2:52:22 PM org.apache.solr.core.SolrResourceLoader replaceClassLoader
INFO: Adding 'file:/home/moon/solr-home/solr/collection1/lib/solr-dataimporthandler-4.2.0.jar' to classloader
May 09, 2013 2:52:22 PM org.apache.solr.core.SolrResourceLoader replaceClassLoader
INFO: Adding 'file:/home/moon/solr-home/solr/collection1/lib/solr-dataimporthandler-extras-4.2.0.jar' to classloader
...
INFO: [collection1] Opening new SolrCore at solr/collection1/, dataDir=/solr-home/data/
May 09, 2013 2:52:25 PM org.apache.solr.core.JmxMonitoredMap <init>
INFO: JMX monitoring is enabled. Adding Solr mbeans to JMX Server: com.sun.jmx.mbeanserver.JmxMBeanServer@4645a73
May 09, 2013 2:52:25 PM org.apache.solr.core.SolrCore initListeners
INFO: [collection1] Added SolrEventListener for newSearcher: org.apache.solr.core.QuerySenderListener{queries=[]}
May 09, 2013 2:52:25 PM org.apache.solr.core.SolrCore initListeners
INFO: [collection1] Added SolrEventListener for firstSearcher: org.apache.solr.core.QuerySenderListener{queries=[{q=static firstSearcher warming in solrconfig.xml}]}
...但过了一会儿它关闭了:
May 09, 2013 2:52:25 PM org.apache.solr.search.SolrIndexSearcher <init>
INFO: Opening Searcher@5b27f008 main
May 09, 2013 2:52:25 PM org.apache.solr.core.SolrCore close
INFO: [collection1] CLOSING SolrCore org.apache.solr.core.SolrCore@78a38bfb
May 09, 2013 2:52:25 PM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener sending requests to Searcher@5b27f008 main{StandardDirectoryReader(segments_1:1)}
May 09, 2013 2:52:25 PM org.apache.solr.update.SolrCoreState decrefSolrCoreState
INFO: Closing SolrCoreState
May 09, 2013 2:52:25 PM org.apache.solr.update.DefaultSolrCoreState closeIndexWriter
INFO: SolrCoreState ref count has reached 0 - closing IndexWriter
...然后它抛出一个 NullPointerException:
May 09, 2013 2:52:25 PM org.apache.solr.common.SolrException log
SEVERE: java.lang.NullPointerException
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:181)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1817)
at org.apache.solr.core.QuerySenderListener.newSearcher(QuerySenderListener.java:64)
at org.apache.solr.core.SolrCore$5.call(SolrCore.java:1606)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
谢谢你能给我的任何帮助。