HTTP状态500 - solr配置中的严重错误。在solr.xml中

时间:2017-04-17 17:01:39

标签: .net apache solr nutch

我正在尝试使用solr nutch安装solr apache进行网页抓取,我正在关注youtube教程https://www.youtube.com/watch?v=Qs-18hRRpNU

这是我的路径C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\solr\WEB-INF,我安装solr.xml文件的位置如下。

以下是在Windows 10中安装Solr Apache与Tomcat的错误,不知道如何将Solr 6与Solr Nutch集成,因此不得不依赖于旧的Solr。以下是错误

**HTTP Status 500 - Severe errors in solr configuration. 
Check your log files for more detailed information on what may be wrong. 
If you want solr to continue after configuration errors, change: 

<abortOnConfigurationError>false</abortOnConfigurationError> in solr.xml
-------------------------------------------------------------**
java.lang.RuntimeException: java.io.IOException: Cannot create directory: 
C:\cygwin64\home\apache-solr-3.4.0\example\solr\.\data\index at 
org.apache.solr.core.SolrCore.initIndex(SolrCore.java:407) at
org.apache.solr.core.SolrCore.<init>(SolrCore.java:552) at
org.apache.solr.core.CoreContainer.create(CoreContainer.java:463) at 
org.apache.solr.core.CoreContainer.load(CoreContainer.java:316) at 
org.apache.solr.core.CoreContainer.load(CoreContainer.java:207) at 
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.jav
a:130) at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:94 at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:298) at 
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:119) at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4142) at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4800) at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:803) at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:780) at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583) at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:944) at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:779) at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:505) at 
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322) at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:325) at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1069) at 
org.apache.catalina.core.StandardHost.start(StandardHost.java:822) at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061) at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at 
org.apache.catalina.core.StandardService.start(StandardService.java:525) at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:761) at 
org.apache.catalina.startup.Catalina.start(Catalina.java:595) 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.catalina.startup.Bootstrap.start(Bootstrap.java:289) at 
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.io.IOException: 
Cannot create directory: C:\cygwin64\home\apache-solr-3.4.0\example\solr\.\data\index at 
org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:171) at 
org.apache.lucene.store.Lock.obtain(Lock.java:72) at 
org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1112) at 
org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:83) at 
org.apache.solr.core.SolrCore.initIndex(SolrCore.java:402) ... 32 more

XML文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<web-app>

  <!-- Uncomment if you are trying to use a Resin version before 3.0.19.
    Their XML implementation isn't entirely compatible with Xerces.
    Below are the implementations to use with Sun's JVM.
  <system-property javax.xml.xpath.XPathFactory=
             "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"/>
  <system-property javax.xml.parsers.DocumentBuilderFactory=
             "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/>
  <system-property javax.xml.parsers.SAXParserFactory=
             "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/>
   -->

  <!-- People who want to hardcode their "Solr Home" directly into the
       WAR File can set the JNDI property here...
   -->
      <env-entry>
       <env-entry-name>solr/home</env-entry-name>
       <env-entry-value>C:\cygwin64\home\apache-solr-3.4.0\example\solr</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
    </env-entry> 


  <!-- Any path (name) registered in solrconfig.xml will be sent to that filter -->
  <filter>
    <filter-name>SolrRequestFilter</filter-name>
    <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
    <!-- If you are wiring Solr into a larger web application which controls
         the web context root, you will probably want to mount Solr under
         a path prefix (app.war with /app/solr mounted into it, for example).
         You will need to put this prefix in front of the SolrDispatchFilter
         url-pattern mapping too (/solr/*), and also on any paths for
         legacy Solr servlet mappings you may be using.
         For the admin JSP's to work properly in a path-prefixed configuration,
         the admin folder containing the JSPs needs to be under the app context root
         named to match the path-prefix.  For example:

            .war
               xxx
                 admin
                   stats.jsp
    -->
    <!--
    <init-param>
      <param-name>path-prefix</param-name>
      <param-value>/</param-value>
    </init-param>
    -->
  </filter>

  <filter-mapping>
    <!--
      NOTE: When using multicore, /admin JSP URLs with a core specified
      such as /solr/coreName/admin/stats.jsp get forwarded by a
      RequestDispatcher to /solr/admin/stats.jsp with the specified core
      put into request scope keyed as "org.apache.solr.SolrCore".

      It is unnecessary, and potentially problematic, to have the SolrDispatchFilter
      configured to also filter on forwards.  Do not configure
      this dispatcher as <dispatcher>FORWARD</dispatcher>.
    -->
    <filter-name>SolrRequestFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <!-- Otherwise it will continue to the old servlets -->

  <servlet>
    <servlet-name>SolrServer</servlet-name>
    <display-name>Solr</display-name>
    <description>Solr Server</description>
    <servlet-class>org.apache.solr.servlet.SolrServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet>
    <servlet-name>SolrUpdate</servlet-name>
    <display-name>SolrUpdate</display-name>
    <description>Solr Update Handler</description>
    <servlet-class>org.apache.solr.servlet.SolrUpdateServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
  </servlet>

  <servlet>
    <servlet-name>Logging</servlet-name>
    <servlet-class>org.apache.solr.servlet.LogLevelSelection</servlet-class>
  </servlet>

  <!-- @Deprecated -->
  <servlet>
    <servlet-name>ping</servlet-name>
    <jsp-file>/admin/ping.jsp</jsp-file>
  </servlet>

  <servlet-mapping>
    <servlet-name>SolrServer</servlet-name>
    <url-pattern>/select/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>SolrUpdate</servlet-name>
    <url-pattern>/update/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>Logging</servlet-name>
    <url-pattern>/admin/logging</url-pattern>
  </servlet-mapping>

  <!-- @Deprecated -->
  <servlet-mapping>
    <servlet-name>ping</servlet-name>
    <url-pattern>/admin/ping</url-pattern>
  </servlet-mapping>

  <!-- @Deprecated -->
  <servlet-mapping>
    <servlet-name>Logging</servlet-name>
    <url-pattern>/admin/logging.jsp</url-pattern>
  </servlet-mapping>

  <mime-mapping>
    <extension>.xsl</extension>
    <!-- per http://www.w3.org/TR/2006/PR-xslt20-20061121/ -->
    <mime-type>application/xslt+xml</mime-type>
  </mime-mapping>

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>

</web-app>

1 个答案:

答案 0 :(得分:0)

查看异常,您的Solr实例似乎无法创建目录:

C:\cygwin64\home\apache-solr-3.4.0\example\solr\.\data\index

确保您的用户(或用于运行Tomcat的用户)有权创建或写入目录。您可以在运行Solr之前创建目录并正确设置所有权限。