solr - org.apache.solr.common.SolrException: Could not load config for solrconfig.xml

错误:org.apache.solr.common.SolrException: Could not load config for solrconfig.xml
解决:solr/home位置不对。让它指向solr-4.1.0\example\solr就行了,我已经copy到WebRoot了。

找到web.xml中的
  <!--
    <env-entry>
       <env-entry-name>solr/home</env-entry-name>
       <env-entry-value>/put/your/solr/home/here</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
   -->
修改成
    <env-entry>
       <env-entry-name>solr/home</env-entry-name>
       <env-entry-value>C:/CHRUAN/workspace/solr-4.1.0/WebRoot/solr</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
错误详情:
2013-3-7 9:06:35 org.apache.solr.core.CoreContainer recordAndThrow
严重: Unable to create core: collection1
org.apache.solr.common.SolrException: Could not load config for solrconfig.xml
 at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:973)
 at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1033)
 at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
 at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:1)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 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:662)
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or 'solr\collection1\conf/', cwd=C:\CHRUAN\develop\eclipse-jee-helios-SR1-win32\eclipse
 at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:316)
 at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:281)
 at org.apache.solr.core.Config.<init>(Config.java:103)
 at org.apache.solr.core.Config.<init>(Config.java:73)
 at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:117)
 at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:971)
 ... 11 more
2013-3-7 9:06:35 org.apache.solr.common.SolrException log
严重: null:org.apache.solr.common.SolrException: Unable to create core: collection1
 at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:1654)
 at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1039)
 at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
 at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:1)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 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:662)
Caused by: org.apache.solr.common.SolrException: Could not load config for solrconfig.xml
 at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:973)
 at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1033)
 ... 10 more
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or 'solr\collection1\conf/', cwd=C:\CHRUAN\develop\eclipse-jee-helios-SR1-win32\eclipse
 at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:316)
 at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:281)
 at org.apache.solr.core.Config.<init>(Config.java:103)
 at org.apache.solr.core.Config.<init>(Config.java:73)
 at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:117)
 at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:971)
 ... 11 more

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值