Mohd Afeef
Mohd Afeef

Reputation: 151

Can't find resource 'solrconfig.xml' in classpath in solr

problem

response

    <response>
    <lst name="responseHeader">
    <int name="status">400</int>
    <int name="QTime">17</int>
    </lst>
    <lst name="error">
    <str name="msg">
    Error CREATEing SolrCore 'new_core': Unable to create core: new_core Caused by: Can't find resource 'solrconfig.xml' in classpath or '/var/lib/tomcat7/solr/new_core/conf'
    </str>
    <int name="code">400</int>
    </lst>
    </response>

error:

  SolrCore Initialization Failures
    afeef: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load config file /var/lib/tomcat7/solr/afeef/solrconfig.xml
    coreX: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load config file /var/lib/tomcat7/solr/path_to_instance_directory/config_file_name.xml
    new_core: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load config file /var/lib/tomcat7/solr/new_core/solrconfig.xml

Upvotes: 14

Views: 27806

Answers (3)

killshot
killshot

Reputation: 81

Go to solr core admin folder.
In mac if you installed it from homebrew, it is /opt/homebrew/var/lib/solr

Now delete the core, that you tried to create and recreate from terminal

solr delete -c my_solr

solr create_core -c y_solr

Hope it helps

Upvotes: 7

zak
zak

Reputation: 876

4 Years on but this was never answered.

The example from the documentation worked for me with version 8.6:

http://:localhost:8983/solr/admin/cores?action=CREATE&name=core-name&instanceDir=path/to/dir&config=solrconfig.xml&dataDir=data

Upvotes: 0

achabahe
achabahe

Reputation: 2565

As it is mentionned in the wiki that you referenced in the link , instanceDir parameter in the http request is a required parameter. config, schema & dataDir parameters are optional. (Default is to look for solrconfig.xml/schema.xml inside instanceDir. Default place to look for dataDir depends on solrconfig.xml.) Example of Create Request

    http://localhost:8983/solr/admin/cores?action=CREATE&name=coreX&instanceDir=path_to_instance_directory&
config=config_file_name.xml&schema=schema_file_name.xml&dataDir=data

Upvotes: 1

Related Questions