在localhost中尝试solr时出错

时间:2013-11-03 18:50:26

标签: apache tomcat solr lucene solr4

我是solr的新手,我遇到了一些问题,并且想知道是否有人可以帮助我。

我遵循了这个:http://crazorsharp.blogspot.com/2010/01/full-text-search-using-solr-lucene-and.html

我下载了:Apache Tomcat / 8.0.0-RC5 和Solr版本4.5.1已下载

如果我尝试http://localhost:8983,我会获得Apache Tomcat网页 但如果我尝试http://localhost:8983/solr,我会收到此错误:

  

HTTP状态404 - / solr

     

输入状态报告

     

message / solr

     

说明请求的资源不可用。

     

Apache Tomcat / 8.0.0-RC5

其他一些人报告了这个错误,这些似乎通过添加:

来修复它
<env-entry>
       <env-entry-name>solr/home</env-entry-name>
       <env-entry-value>c:/solr</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>

这对我没用:(

请问好吗?

顺便说一句:

In logs I'm getting these errors:
03-Nov-2013 21:18:26.623 INFO [http-apr-8983-exec-20] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\Catalina\localhost\solr.xml
03-Nov-2013 21:18:26.628 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/solrcloud/str'.
03-Nov-2013 21:18:26.628 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/solrcloud/int'.
03-Nov-2013 21:18:26.629 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/solrcloud/str'.
03-Nov-2013 21:18:26.629 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/solrcloud/int'.
03-Nov-2013 21:18:26.629 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/solrcloud/bool'.
03-Nov-2013 21:18:26.629 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/solrcloud'.
03-Nov-2013 21:18:26.629 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/shardHandlerFactory/int'.
03-Nov-2013 21:18:26.629 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/shardHandlerFactory/int'.
03-Nov-2013 21:18:26.630 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/shardHandlerFactory'.
03-Nov-2013 21:18:26.630 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/Context/Environment'.
03-Nov-2013 21:18:26.630 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr/Context'.
03-Nov-2013 21:18:26.630 WARNING [http-apr-8983-exec-20] org.apache.tomcat.util.digester.Digester.endElement   No rules found matching 'solr'.
03-Nov-2013 21:18:27.456 SEVERE [http-apr-8983-exec-20] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
 org.apache.catalina.LifecycleException: Failed to start component [/solr]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:574)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:450)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1534)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1430)
    at org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:306)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:214)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:616)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:76)
    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:515)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1012)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:642)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:282)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2461)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2450)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to process either the global, per-host or context-specific context.xml file therefore the [/solr] Context cannot be started.
    at org.apache.catalina.startup.FailedContext.startInternal(FailedContext.java:198)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 45 more

03-Nov-2013 21:18:27.457 SEVERE [http-apr-8983-exec-20] org.apache.catalina.startup.HostConfig.deployDescriptor Error deploying configuration descriptor C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\Catalina\localhost\solr.xml
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [/solr]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:574)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:450)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1534)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1430)
    at org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:306)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:214)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:616)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:76)
    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:515)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1012)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:642)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:282)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2461)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2450)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

03-Nov-2013 21:18:33.987 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.reload Reloading context [/Solr]
03-Nov-2013 21:18:35.422 WARNING [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.reload Error during context [/Solr] restart
 org.apache.catalina.LifecycleException: Failed to start component [/Solr]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1350)
    at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1277)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1512)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:274)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1143)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1358)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1362)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1336)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to process either the global, per-host or context-specific context.xml file therefore the [/Solr] Context cannot be started.
    at org.apache.catalina.startup.FailedContext.startInternal(FailedContext.java:198)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 11 more

1 个答案:

答案 0 :(得分:0)

solr-xxx.war重命名为solr.war并将其放置在Tomcat的webapps文件夹中。还要确保在solr/home目录中有正确的配置。

我的solr.xml:

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="c:/solr/solr.war" debug="0" crossContext="true">
    <Environment name="solr/home" type="java.lang.String" value="c:/solr/" override="true"/>
</Context>