1

我对 Solr 有一点问题。我想在tomcat环境中启动应用程序。我尝试了不同的教程,但没有任何效果。

我已经使用 Tomcat Web 应用程序管理器打开了 solr.war 文件。在我看来,这与将war文件复制到tomcat目录的webapp文件夹中是一样的。应用程序已成功加载!当我转到 localhost:8080/solr/ 时,我得到了一些错误。

在我看来,某些配置文件中缺少路径,但我不知道是哪一个。

HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: 
Could not load config for solrconfig.xml,trace=org.apache.solr.common.SolrException: 
SolrCore 'collection1' is not available due to init failure: Could not load config for 
solrconfig.xml at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:860) at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:251) at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.jav
a:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:223) at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107) at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:75) at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934) at 

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:90) at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:494) at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009) 
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:
632) at 
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtoco
l.java:281) at 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2248) at 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2237) 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:724) Caused by: org.apache.solr.common.SolrException: 
Could not load config for solrconfig.xml at 
org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:592) at 
org.apache.solr.core.CoreContainer.create(CoreContainer.java:657) at 
org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:364) at 
org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:356) at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at 
java.util.concurrent.FutureTask.run(FutureTask.java:166) at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at 
java.util.concurrent.FutureTask.run(FutureTask.java:166) ... 3 more Caused by: 
java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or 'C:solrsolr-
multicore\collection1\conf/', cwd=D:\Suchmaschine\Tomcat\Software\apache-tomcat-8.0.0-RC1-
windows-x64\apache-tomcat-8.0.0-RC1\bin at 
org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:322) at 
org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:287) 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:120) at 
org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:589) ... 11 more 
,code=500}
4

3 回答 3

2

查看http://amac4.blogspot.com/2013/07/setting-up-solr-with-apache-tomcat-be.html

有一个很好的使用 tomcat 7 设置它的指南,它不会改变 tomcat 8

于 2013-09-10T20:26:10.563 回答
1

在 Windows 上的 Tomcat 7 上部署 solr 4.9.1 时,我遇到了类似的问题。问题是 tomcat 无法识别正确的 solr 主目录。通过在 catalina.bat 中添加以下代码段来解决此问题

设置“JAVA_OPTS=%JAVA_OPTS%-Dsolr.solr.home=”

于 2015-08-30T13:48:55.563 回答
0

你设置了 solr.home 吗?

在 catalina.sh (/usr/share/tomcat/bin/catalina.sh) 中:

JAVA_OPTS="-Dsolr.solr.home=/etc/tomcat6/solr -Djava.awt.headless=true -server -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
于 2013-09-10T21:06:12.110 回答