简体   繁体   English

在 solr 的类路径中找不到资源“solrconfig.xml”

[英]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
  • when i run this cmd当我运行这个 cmd

    ps aux|grep java ps 辅助|grep java

    tomcat7 23192 0.7 2.0 2579744 161852? tomcat7 23192 0.7 2.0 2579744 161852? Sl 16:22 0:11 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start mohd 24047 0.0 0.0 15948 2276 pts/14 S+ 16:45 0:00 grep --color=auto java Sl 16:22 0:11 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging .manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin /bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp /tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start mohd 24047 0.0 0.0 15948 2276 pts/14 S+ 16:45 0:00 grep --color=auto java

  • it was working properly suddenly it throws error.它突然正常工作它会引发错误。

As it is mentionned in the wiki that you referenced in the link , instanceDir parameter in the http request is a required parameter.正如您在链接中引用的 wiki 中提到的那样,http 请求中的 instanceDir 参数是必需参数。 config, schema & dataDir parameters are optional. config、schema 和 dataDir 参数是可选的。 (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 (默认是在 instanceDir 中查找 solrconfig.xml/schema.xml。查找 dataDir 的默认位置取决于 solrconfig.xml。)创建请求示例

    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

4 Years on but this was never answered. 4 年过去了,但这从未得到回答。

The example from the documentation worked for me with version 8.6: 文档中的示例适用于 8.6 版:

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

Go to solr core admin folder. Go 到 solr 核心管理文件夹。
In mac if you installed it from homebrew, it is /opt/homebrew/var/lib/solr在 mac 中,如果你是从 homebrew 安装的,它是/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希望能帮助到你

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在solr 5.1.0中找到正确的solrconfig.xml文件以进行配置 - Cannot Find Proper solrconfig.xml file for configuration in solr 5.1.0 是否可以向Solr服务器动态提供solrconfig.xml和schema.xml文件? - Can I provide solrconfig.xml and schema.xml files dynamically to Solr server? Solr-如何使用“ dir”属性 <lib> 标记,在solrconfig.xml中 - Solr - How to use “dir” attribute of <lib> tag, in solrconfig.xml solr.Caused by:java.lang.RuntimeException:[solrconfig.xml] requestHandler:缺少必需属性&#39;class&#39; - solr.Caused by: java.lang.RuntimeException: [solrconfig.xml] requestHandler: missing mandatory attribute 'class' solrconfig.xml中的更改后,SolrJ中的异常 - Exception in SolrJ after change in solrconfig.xml IntelliJ 找不到类路径测试资源 - IntelliJ can't find classpath test resource PMD + Maven + JAVA错误::无法找到资源rulesets / comments.xml。 确保资源是有效的文件或URL,或者位于CLASSPATH上 - PMD+Maven+JAVA Error:: Can't find resource rulesets/comments.xml. Make sure the resource is a valid file or URL or is on the CLASSPATH Datastax DSE搜索:如何使用Java发布solrconfig.xml和schema.xml? - Datastax DSE Search : How to post solrconfig.xml and schema.xml using java? 在JAR中找不到类路径资源(没有这样的文件或目录) - Can't find classpath resource in JAR (No such file or directory) 运行jar时找不到类路径中的资源 - can't find the resource which is in classpath while running the jar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM