HTTP状态500错误 - 在Ubuntu 13上使用Tomcat 8安装Solr 4.6.1

时间:2014-02-26 22:21:07

标签: tomcat ubuntu solr

我想在Ubuntu Desktop 13.10上使用tomcat 8.0.3安装solr-4.6.1,但是无法启动Solr。

我已按照以下步骤操作:

对于Tomcat

  1. 我下载了apache-tomcat-8.0.3.tar.gz
  2. 将文件提取到〜/ Desktop / Tomcat8
  3. 编辑.bashrc文件并添加了行导出CATALINA_HOME =〜/ Desktop / Tomcat8
  4. 在〜/ Desktop / Tomcat8 / bin中创建了一个名为setenv.sh的文件,内容为

      

    JAVA_HOME = / usr / lib中/ JVM /默认-java的

  5.      我通过浏览到

    来测试Tomcat安装
    http://localhost:8080
    

    它工作正常并显示Tomcat主页。

    对于Solr

    1. 我下载了solr-4.6.1.tgz
    2. 将文件提取到〜/ Desktop / solr-4.6.1
    3. 将〜/ Desktop / solr-4.6.1 / example / solr /中的所有内容复制到〜/ Desktop / Solr /
    4. 将〜/ Desktop / solr-4.6.1 / example / lib / ext中的所有jar文件复制到〜/ Desktop / Tomcat8 / lib /
    5. 将〜/ Desktop / solr-4.6.1 / example / webapps中的solr.war复制到〜/ Desktop / Tomcat8 / webapps /
    6. 编辑了“〜/ Desktop / Tomcat8 / webapps / solr / WEB-INF / web.xml文件,取消注释了env-entry部分,用〜/ Desktop / Solr <替换/ put / your / solr / home / here / LI>
    7. 编辑〜/ Desktop / Tomcat8 / bin / setenv.sh并添加了行

        

      JAVA_OPTS = “ - Dsolr.solr.home =〜/桌面/ Solr的”

    8.   

           

      问题

      当我导航到

      http://localhost:8080/solr
      

      浏览器显示以下错误

      HTTP Status 500 - {msg=SolrCore 'collection1' is not available
      due to init failure: Could not load config file
      /home/handosa/~/Desktop/Solr/collection1/solrconfig.xml,
      trace=org.apache.solr.common.SolrException: SolrCore 'collection1'
      is not available due to init failure: Could not load config file 
      /home/handosa/~/Desktop/Solr/collection1/solrconfig.xml
      at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:823)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:301)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:201)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
      at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: org.apache.solr.common.SolrException: Could not load config file
      /home/handosa/~/Desktop/Solr/collection1/solrconfig.xml at
      org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:530)
      at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597)
      at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:251)
      at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:243)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262) ... 3 more
      Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or 
      '/home/handosa/~/Desktop/Solr/collection1/conf'
      at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:342)
      at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:288)
      at org.apache.solr.core.Config.<init>(Config.java:116) at org.apache.solr.core.Config.<init>(Config.java:86)
      at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:139)
      at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:527) ... 9 more ,code=500}
      

      我错过了什么吗?

      修改

      似乎整个问题都是使用路径〜/ Desktop / Solr。 所以,我使用/ home / handosa / Desktop / Solr,现在一切正常!

0 个答案:

没有答案