如何修复 java RuntimeException: Can't find resource 'solrconfig.xml'? [英] How to fix java RuntimeException: Can't find resource 'solrconfig.xml'?
问题描述
我使用 Ubuntu 8.10 作为 Solr 服务器操作系统,并设置:
I used Ubuntu 8.10 as the Solr server OS, and set:
solr.solr.home=home/huenzhao/search/tomcat6/bin/solr.
运行tomcat时(我在windows XP上用的tomcat和Solr都没有问题,报错如下:
When I run the tomcat(The tomcat and the Solr that I used running on windows XP has no problem, there has error as :
HTTP Status 500 - Severe errors in solr configuration. Check your log files for more detailed information on what may be wrong. If you want solr to continue after configuration errors, change: <abortOnConfigurationError>false</abortOnConfigurationError> in null -------------------------------------------------------------
java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpath or 'home/huenzhao/search/tomcat6/bin/solr/conf/', cwd=/home/huenzhao/search/tomcat6/bin at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:194) at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:162) at org.apache.solr.core.Config.<init>(Config.java:100) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:113) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:70) at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:117) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:69) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3696) at
有人知道怎么做吗?
推荐答案
我怀疑你只需要一个前导斜杠来表明你的目录名称是绝对的而不是相对的:
I suspect you just need a leading slash to indicate that your directory name is absolute rather than relative:
solr.solr.home=/home/huenzhao/search/tomcat6/bin/solr
如果不是这样,请发布您的 solrconfig.xml
文件所在的位置.
If that's not it, please post where your solrconfig.xml
file lives.
在 Windows 机器上,按照以下几行更新 solr/web.xml
中的 solr/home
属性:
On a Windows machine, update the solr/home
property in solr/web.xml
along these lines:
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>C:/solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
这篇关于如何修复 java RuntimeException: Can't find resource 'solrconfig.xml'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!