solr.Caused by:java.lang.RuntimeException:[solrconfig.xml] requestHandler:缺少必需属性'class'

时间:2014-01-02 18:21:50

标签: java mysql solr lucene search-engine

我尝试用apache Solr介绍。在此资源中,我找到了一个热门问题:Apache Solr java tutorials

我试着从1个链接开始: simple example

当我到达这一点时

  
      
  1. 停止并重新启动solr实例。检查是否有任何jdbc错误,如果没有正确安装jdbc驱动程序,可能会发生这种情况。
  2.   

我看到下一个跟踪(上一个版本):

      2875 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer  Ц F
ailed to load file D:\solr2\example\solr\collection1\solrconfig.xml
2875 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer  Ц U
nable to create core: collection1
org.apache.solr.common.SolrException: Could not load config file D:\solr2\exampl
e\solr\collection1\solrconfig.xml
        at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java
:525)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:592)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:271)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:263)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: [solrconfig.xml] requestHandler: missing
mandatory attribute 'class'
        at org.apache.solr.util.DOMUtil.getAttr(DOMUtil.java:80)
        at org.apache.solr.util.DOMUtil.getAttr(DOMUtil.java:87)
        at org.apache.solr.core.PluginInfo.<init>(PluginInfo.java:51)
        at org.apache.solr.core.SolrConfig.readPluginInfos(SolrConfig.java:296)
        at org.apache.solr.core.SolrConfig.loadPluginInfo(SolrConfig.java:281)
        at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:219)
        at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java
:522)
        ... 11 more
2875 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer  Ц n
ull:org.apache.solr.common.SolrException: Unable to create core: collection1
        at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:
977)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:601)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:271)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:263)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Could not load config file D:\s
olr2\example\solr\collection1\solrconfig.xml
        at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java
:525)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:592)
        ... 10 more
Caused by: java.lang.RuntimeException: [solrconfig.xml] requestHandler: missing
mandatory attribute 'class'
        at org.apache.solr.util.DOMUtil.getAttr(DOMUtil.java:80)
        at org.apache.solr.util.DOMUtil.getAttr(DOMUtil.java:87)
        at org.apache.solr.core.PluginInfo.<init>(PluginInfo.java:51)
        at org.apache.solr.core.SolrConfig.readPluginInfos(SolrConfig.java:296)
        at org.apache.solr.core.SolrConfig.loadPluginInfo(SolrConfig.java:281)
        at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:219)
        at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java
:522)
        ... 11 more

2875 [main] INFO  org.apache.solr.servlet.SolrDispatchFilter  Ц user.dir=D:\solr
2\example
2875 [main] INFO  org.apache.solr.servlet.SolrDispatchFilter  Ц SolrDispatchFilt
er.init() done
2922 [main] INFO  org.eclipse.jetty.server.AbstractConnector  Ц Started SocketCo
nnector@0.0.0.0:8983

你能帮助我吗?

更新

enter image description here

solrconfig.xml中:

http://www.mediafire.com/view/2b67m83v5cy05zd/solrconfig.xml

1 个答案:

答案 0 :(得分:0)

找不到您的solr配置文件:

无法加载配置文件D:\ solr2 \ example \ solr \ collection1 \ solrconfig.xml

仔细检查您的solr配置文件是否在指定目录中。