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

后端 未结 5 1555
有刺的猬
有刺的猬 2020-12-09 18:46

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 a

相关标签:
5条回答
  • 2020-12-09 19:33

    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>
    
    0 讨论(0)
  • 2020-12-09 19:33

    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.

    0 讨论(0)
  • 2020-12-09 19:35

    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.

    0 讨论(0)
  • 2020-12-09 19:38

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

    0 讨论(0)
  • 2020-12-09 19:40

    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>
    
    0 讨论(0)
提交回复
热议问题