EthanHu
EthanHu

Reputation: 87

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?

Upvotes: 13

Views: 51333

Answers (5)

Jon Skeet
Jon Skeet

Reputation: 1503220

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>

Upvotes: 16

POONAM MEHTA
POONAM MEHTA

Reputation: 1

I have update property of solr/home from solr/web.xml as below ; and it is worked.

 <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>

Upvotes: 3

Srinivas
Srinivas

Reputation: 1

Windows

In my solr.xml I set solr/home to d:\tomcat 6.0.

And copied the contents of conf folder which comes as part of solr extract into d:\tomcat 6.0\conf folder.

It will surely work for you. please note this is a windows based solution accordingly you need to try for other systems.

Upvotes: 1

Marco Schoolenberg
Marco Schoolenberg

Reputation: 743

I was running into the same problem both on a windows machine at home and on a hosted VPS linux machine. The solution turned out to be I didn't actually have a directory conf in webapps/solr and this not correct path to solrconfig.xml

The path is to be configured in solr.xml which should reside either inside your-tomcat/conf/Catalina/localhost/

or on the class path.

Upvotes: 3

Nikhil Dinesh
Nikhil Dinesh

Reputation: 3409

for solving this you have to add 1. Download the Solr package form the following path http://www.trieuvan.com/apache//lucene/solr/3.1.0/apache-solr-3.1.0.zip

  1. Extract it and copy the file 'dist/apache-solr-3.1.0.war' to Tomcat's webapps folder as solr.war

  2. Make a folder c:/solr (Which will be our Solr home and all the index will live here) and copy the folder contents of 'examples/solr/' from extracted files to this location

  3. Edit the file catalina.bat and apply the following patch (you can also do it manually, just adding a line)

    @@ -84,7 +84,8 @@ rem $Id: catalina.bat 1040546 2010-11-30 14:47:34Z markt $ rem ---------------------------------------------------------------------------

    - +rem Adding solr home path +set JAVA_OPTS=%JAVA_OPTS% -Dsolr.solr.home=c:/solr

and install tomcat windows service(which is in tomcat/bin) Try this....

Upvotes: 2

Related Questions