Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
995 views
in Technique[技术] by (71.8m points)

solr - How to fix java RuntimeException: Can't find resource 'solrconfig.xml'?

I used Ubuntu 8.10 as the Solr server OS, and set:

solr.solr.home=home/huenzhao/search/tomcat6/bin/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 

Anybody knows how to do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

If that's not it, please post where your solrconfig.xml file lives.

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...