当前位置: 首页 > 知识库问答 >
问题:

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

凤衡
2023-03-14

问题

  • 我无法访问solr管理页。
  • 在本地系统上运行url时:http://localhost:8983/solr/admin/cores?action=create&name=new_core&configset=basic_configs

回应

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

>

  • 我已重新链接:https://wiki.apache.org/solr/coreadmin

    solr.xml代码

    <solr persistent="false">
        <cores adminPath="/admin/cores">
            <core name="afeef" instanceDir="afeef" />
        </cores>
    </solr>
    
      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
    

    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/tomcat7-dcatalina.home=/usr/share/tomcat7-djava.io.tmpdir=/tmp/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

    它本来正常工作的,突然出现了错误。

  • 共有1个答案

    斜和硕
    2023-03-14

    正如您在链接中引用的wiki中提到的,http请求中的instanceDir参数是必需的参数。config、schema和dataDir参数是可选的。(默认情况是在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
    
     类似资料:
    • 我遇到一个问题,IntelliJ13.1.4在运行单元测试时,在模块的目录中找不到文件。 在回答之前请注意,我已经完成了以下所有操作: 该模块是一个分级项目,如果我运行,单元测试运行良好。 我过去在IntelliJ中成功地运行了这个单元测试,它找到了模块。(也许是Intellij的早期版本?) 我已经检查了IntelliJ模块设置,并且目录被标记为测试资源目录。(见下面的截图。) 我正在类中转储单

    • 我创建了一个原型为maven archetype webapp的maven项目,然后为了将我的应用程序公开为rest webservice,我正在使用RestEasy,但是在rest应用程序中实现后,我无法访问我创建的URL。请告诉我我做错了什么。感谢您阅读此问题。 我的UserManagementController如下: 我的MyRestWS. java如下: 我的网站。xml如下: 该应用程

    • 我正在尝试在Quarkus中配置Swagger。Quarkus的我的版本:1.9.2。最终的 我的依赖关系: 和我的财产资源: 使用:mvn启动应用程序时,请编译quarkus:dev并转到以下url: <代码>http://localhost:8080/swagger-找不到ui\u/ 但是,如果我用maven(mvn包)制作一个包,然后启动jar,则返回相同的url: RESTEASY0032

    • 在spring boot 1.1.5和1.1.6中都有这个问题--我正在使用@value注释加载一个类路径资源,当我从STS(3.6.0,Windows)中运行应用程序时,它可以正常工作。但是,当我运行一个mvn包,然后尝试运行jar时,我得到了FileNotFound异常。 资源message.txt位于src/main/resources中。我已经检查了jar,并验证它在顶层(与applica

    • 我正在使用我的第一个spring helloworld程序,使用STS和maven,这是一个简单的IOC示例 和实现类 还有例外 L 它显示无法找到xml文件的位置,但我指定了我使用Spring工具套件mvc maven项目的位置

    • 我正在执行Java-Eclipse-TestNG,但在使用testng命令行运行测试时遇到了困难。我有多个源文件夹,当创建。class文件时,它们将转到/bin目录,文件夹结构与/src相同,如下所示。我已经设置了类路径(使用导出classpath=...)并尝试运行“java org.testng.testng testng.xml”,但它给我的结果是“不能在类路径中找到类:testcases.