Java 由于初始化失败,SolrCore 'collection1' 不可用..在编辑文件并授予权限后

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20512282/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 02:27:38  来源:igfitidea点击:

SolrCore 'collection1' is not available due to init failure..after editing files and granting permissions

javatomcatsolr

提问by yugal

I am having this error since long time. Its about collection1. I have changed the permission , edited the solrconfig.xml but still no improve ment here is my status report

我有这个错误很长时间了。它关于 collection1。我已经更改了权限,编辑了 solrconfig.xml 但仍然没有改进,这是我的状态报告

HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: Could not load config file /var/lib/tomcat7/solr/collection1/solrconfig.xml,trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: Could not load config file /var/lib/tomcat7/solr/collection1/solrconfig.xml at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:818) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:297) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:197) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:701) Caused by: org.apache.solr.common.SolrException: Could not load config file /var/lib/tomcat7/solr/collection1/solrconfig.xml at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:525) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:592) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:271) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:263) 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 '/var/lib/tomcat7/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.(Config.java:116) at org.apache.solr.core.Config.(Config.java:86) at org.apache.solr.core.SolrConfig.(SolrConfig.java:129) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:522) ... 11 more ,code=500}

HTTP 状态 500 - {msg=SolrCore 'collection1' 由于初始化失败而无法使用:无法加载配置文件 /var/lib/tomcat7/solr/collection1/solrconfig.xml,trace=org.apache.solr.common.SolrException :由于初始化失败,SolrCore 'collection1' 不可用:无法在 org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:818) 加载配置文件 /var/lib/tomcat7/solr/collection1/solrconfig.xml ) 在 org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:297) 在 org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:197) 在 org.apache.catalina.core.ApplicationFilterChain。 internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core。StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.invoke(StandardHostValve)。 .apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) 在 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) 在 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.invoke(AccessLogValve.java:927) .java:118) 在 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 在 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) 在 org.apache.coyote。 AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) 在 org.apache.tomcat.util.net.JioEndpoint$SocketProcessor.run(JioEndpoint.java:309) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 在 java.lang.Thread.run(Thread.java) :701) 引起:org.apache.solr.common.SolrException:无法在 org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.createFromLocal(CoreContainer. java:525) 在 org.apache.solr.core.CoreContainer.create(CoreContainer.java:592) 在 org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:271) 在 org.apache.solr。 core.CoreContainer$1.call(CoreContainer.java:263) 在 java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 在 java.util.concurrent.FutureTask.run(FutureTask.java:166) 在java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 在 java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 在 java.util.concurrent.FutureTask.run(FutureTask.java:166) ... 3 更多 引起:java.io。 IOException: 在 org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:342) 的类路径中找不到资源“solrconfig.xml”或“/var/lib/tomcat7/solr/collection1/conf” .apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:288) 在 org.apache.solr.core.Config.(Config.java:116) 在 org.apache.solr.core.Config.(Config.java) :86) 在 org.apache.solr.core.SolrConfig.(SolrConfig.java:129) 在 org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:522) ... 11 更多,代码 = 500}java:166) ... 3 导致:java.io.IOException:在类路径中找不到资源“solrconfig.xml”或 org.apache 中的“/var/lib/tomcat7/solr/collection1/conf”。 solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:342) 在 org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:288) 在 org.apache.solr.core.Config.(Config.java:116) ) 在 org.apache.solr.core.Config.(Config.java:86) 在 org.apache.solr.core.SolrConfig.(SolrConfig.java:129) 在 org.apache.solr.core.CoreContainer.createFromLocal( CoreContainer.java:522) ... 还有 11 个,代码=500}java:166) ... 3 导致:java.io.IOException:在类路径或 org.apache 中找不到资源“solrconfig.xml”或“/var/lib/tomcat7/solr/collection1/conf”。 solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:342) 在 org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:288) 在 org.apache.solr.core.Config.(Config.java:116) ) 在 org.apache.solr.core.Config.(Config.java:86) 在 org.apache.solr.core.SolrConfig.(SolrConfig.java:129) 在 org.apache.solr.core.CoreContainer.createFromLocal( CoreContainer.java:522) ... 还有 11 个,代码=500}342) 在 org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:288) 在 org.apache.solr.core.Config.(Config.java:116) 在 org.apache.solr.core.Config。 (Config.java:86) at org.apache.solr.core.SolrConfig.(SolrConfig.java:129) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:522) ... 11 更多,代码=500}342) 在 org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:288) 在 org.apache.solr.core.Config.(Config.java:116) 在 org.apache.solr.core.Config。 (Config.java:86) at org.apache.solr.core.SolrConfig.(SolrConfig.java:129) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:522) ... 11 更多,代码=500}

plz suggest me a solution... thanx in adavance

请建议我一个解决方案......谢谢提前

采纳答案by Jeffrey

Make sure the /var/lib/tomcat7/solr/ is the tomcat user.

确保 /var/lib/tomcat7/solr/ 是 tomcat 用户。

sudo chown -R tomcat /var/lib/tomcat7/solr/

Then restart tomcat.

然后重启tomcat。

回答by user3213189

I had a similar error message and found (finally) in catalina.(date).log the following message:

我有一个类似的错误消息,并(终于)在 catalina.(date).log 中发现了以下消息:

"SEVERE: Environmental entry solr/home has an invalid type"

“严重:环境条目 solr/home 的类型无效”

I had an error in /etc/tomcat7/Catalina/localhost/solr.xml where I had written: type="java.lang.string" <- WRONG, and I had to CORRECT -> "java.lang.String"

我在 /etc/tomcat7/Catalina/localhost/solr.xml 中写了一个错误:type="java.lang.string" <- 错误,我必须更正-> "java.lang.String"

Your typing is probably better than mine but something to keep in mind when all your permissions, etc. are set correctly.

您的打字可能比我的好,但是当您的所有权限等设置正确时,请记住一些事情。

回答by condalezarice

I had the same issue, and solved it by restarting tomcat as the tomcat user (I started it with root when I got the error):

我遇到了同样的问题,并通过以 tomcat 用户身份重新启动 tomcat 来解决它(当我收到错误时,我用 root 启动它):

sudo -u tomcat /opt/tomcat/bin/startup.sh

须藤 -u tomcat /opt/tomcat/bin/startup.sh

回答by Praveen Ranjan

I had the same issue, Issue occurred due to started tomcat as root user. solved it by restarting tomcat as the tomcat user.

我遇到了同样的问题,由于以 root 用户身份启动 tomcat 而出现问题。通过以 tomcat 用户身份重新启动 tomcat 来解决它。

回答by sumit dugar

Please make sure that you have correctly defined your solr.solr.home variable. It should point to your solr indexer. If you are not using this variable make sure the path to solrconfig.xml is in the PATH variable

请确保您已正确定义 solr.solr.home 变量。它应该指向您的 solr 索引器。如果您不使用此变量,请确保 solrconfig.xml 的路径在 PATH 变量中

回答by Nahid

For me I have to update

对我来说,我必须更新

vi $CATALINA_HOME/webapps/solr/WEB-INF/web.xml

vi $CATALINA_HOME/webapps/solr/WEB-INF/web.xml

Un-comment and update :

取消评论并更新:

<env-entry>
   <env-entry-name>solr/home</env-entry-name>
   <env-entry-value>/opt/solr/example/solr</env-entry-value>
   <env-entry-type>java.lang.String</env-entry-type>
</env-entry>