apache - Solr - DataImportHandler : Indexing failed. 回滚所有更改

标签 apache tomcat solr dataimporthandler catalina

我在 Windows 环境的 Tomcat 下运行 Solr 4.4。 我已经设置了 DataImportHandler 并尝试从 SQL Server Express 2012 获取数据。在 SQL Server 实例上启用了 TCP/IP。

当我运行索引例程 (http://server.com:8080/solr/dataimport?command=full-import) 时,我收到错误“索引失败。已回滚所有更改。”

响应

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">7</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</lst>
<str name="command">full-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
<str name="Time Elapsed">0:1:19.495</str>
<str name="Total Requests made to DataSource">1</str>
<str name="Total Rows Fetched">0</str>
<str name="Total Documents Processed">0</str>
<str name="Total Documents Skipped">0</str>
<str name="Full Dump Started">2013-08-14 11:20:59</str>
<str name="">Indexing failed. Rolled back all changes.</str>
<str name="Rolledback">2013-08-14 11:21:28</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>

来自 Solr 管理界面的日志行

12:24:08 WARN SimplePropertiesWriter Unable to read: dataimport.properties

solrconfig.xml 请求处理程序

<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">  
  <lst name="defaults">  
    <str name="config">data-config.xml</str>  
  </lst>  
</requestHandler>

data-config.xml

<dataConfig>  
  <dataSource type="JdbcDataSource" 
        driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
        url="jdbc:sqlserver://localhost\SQLEXPRESS2012;databaseName=dbname" 
        user="username" 
        password="password" 
        batchSize="-1" />

  <document name="products">  
    <entity name="product" query="  
        SELECT 

        ProductID,
        ProductNumber,
        ProductName,
        ProductShortDescription,
        ProductLongDescription,
        ProductPrice,
        ProductStock,
        ProductWeight,
        ProductVolume,
        ProductRating,
        color,
        capacity,
        suctionpower,
        noise,
        energyefficiency,
        centrifugation,
        washingcapacity,
        automaticdefrosting,
        bestintest,
        greenenergy,
        discount,
        testwinner,
        funded,
        productsubname,
        werecommend

        FROM EcomProducts">  

        <field column="ProductID" name="ProductID"/> 
        <field column="ProductNumber" name="ProductNumber"/> 
        <field column="ProductName" name="ProductName"/> 
        <field column="ProductShortDescription" name="ProductShortDescription"/> 
        <field column="ProductLongDescription" name="ProductLongDescription"/> 
        <field column="ProductPrice" name="ProductPrice"/> 
        <field column="ProductStock" name="ProductStock"/> 
        <field column="ProductWeight" name="ProductWeight"/> 
        <field column="ProductVolume" name="ProductVolume"/> 
        <field column="ProductRating" name="ProductRating"/> 
        <field column="color" name="color"/> 
        <field column="capacity" name="capacity"/> 
        <field column="suctionpower" name="suctionpower"/> 
        <field column="noise" name="noise"/> 
        <field column="energyefficiency" name="energyefficiency"/> 
        <field column="centrifugation" name="centrifugation"/> 
        <field column="washingcapacity" name="washingcapacity"/> 
        <field column="automaticdefrosting" name="automaticdefrosting"/> 
        <field column="bestintest" name="bestintest"/> 
        <field column="greenenergy" name="greenenergy"/> 
        <field column="discount" name="discount"/> 
        <field column="testwinner" name="testwinner"/> 
        <field column="funded" name="funded"/> 
        <field column="productsubname" name="productsubname"/> 
        <field column="werecommend" name="werecommend"/> 

    </entity>  
  </document>  
</dataConfig> 

schema.xml

 <fields>

 <field name="ProductID" type="string" indexed="true" stored="false" required="true" />  
 <field name="ProductNumber" type="string" indexed="true" stored="true" required="true" /> 
 <field name="ProductName" type="string" indexed="true" stored="true" required="true" />
 <field name="ProductShortDescription" type="string" indexed="true" stored="false" required="true" />
 <field name="ProductLongDescription" type="string" indexed="true" stored="false" required="true" /> 
 <field name="ProductPrice" type="float" indexed="true" stored="false" required="true" />

 <field name="ProductStock" type="float" indexed="true" stored="false" required="false" />
 <field name="ProductWeight" type="float" indexed="true" stored="false" required="false" />
 <field name="ProductVolume" type="float" indexed="true" stored="false" required="false" />
 <field name="ProductRating" type="float" indexed="true" stored="false" required="false" />
 <field name="color" type="string" indexed="true" stored="false" required="false" />
 <field name="capacity" type="string" indexed="true" stored="false" required="false" />
 <field name="suctionpower" type="string" indexed="true" stored="false" required="false" />
 <field name="noise" type="string" indexed="true" stored="false" required="false" />
 <field name="energyefficiency" type="string" indexed="true" stored="false" required="false" />
 <field name="centrifugation" type="string" indexed="true" stored="false" required="false" />
 <field name="washingcapacity" type="string" indexed="true" stored="false" required="false" />
 <field name="automaticdefrosting" type="boolean" indexed="true" stored="false" required="false" />
 <field name="bestintest" type="boolean" indexed="true" stored="false" required="false" />
 <field name="greenenergy" type="boolean" indexed="true" stored="false" required="false" />
 <field name="discount" type="string" indexed="true" stored="false" required="false" />
 <field name="testwinner" type="boolean" indexed="true" stored="false" required="false" />
 <field name="funded" type="string" indexed="true" stored="false" required="false" />
 <field name="productsubname" type="string" indexed="true" stored="false" required="false" />
 <field name="werecommend" type="boolean" indexed="true" stored="false" required="false" />
<!-- Main body of document extracted by SolrCell.
        NOTE: This field is not indexed by default, since it is also copied to "text"
        using copyField below. This is to save space. Use this field for returning and
        highlighting document content. Use the "text" field to search the content. -->
   <field name="content" type="text_general" indexed="false" stored="true" multiValued="true"/>


   <!-- catchall field, containing all other searchable text fields (implemented
        via copyField further on in this schema  -->
   <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>

   <!-- catchall text field that indexes tokens both normally and in reverse for efficient
        leading wildcard queries. -->
   <field name="text_rev" type="text_general_rev" indexed="true" stored="false" multiValued="true"/>

   <!-- non-tokenized version of manufacturer to make it easier to sort or group
        results by manufacturer.  copied from "manu" via copyField -->
   <field name="manu_exact" type="string" indexed="true" stored="false"/>

   <field name="payloads" type="payloads" indexed="true" stored="true"/>

   <field name="_version_" type="long" indexed="true" stored="true"/>


 </fields>
 <uniqueKey>ProductID</uniqueKey>
<copyField source="ProductName" dest="text"/>
<defaultSearchField>text</defaultSearchField> 

卡特琳娜日志

aug 14, 2013 11:20:52 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Tomcat\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;;.
aug 14, 2013 11:20:52 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
aug 14, 2013 11:20:52 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
aug 14, 2013 11:20:52 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 374 ms
aug 14, 2013 11:20:52 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
aug 14, 2013 11:20:52 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
aug 14, 2013 11:20:52 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Tomcat\conf\Catalina\localhost\solr.xml
aug 14, 2013 11:20:52 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase c:\Tomcat\webapps\solr.war inside the host appBase has been specified, and will be ignored
aug 14, 2013 11:20:52 AM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug' to '0' did not find a matching property.
aug 14, 2013 11:20:52 AM org.apache.tomcat.util.digester.Digester endElement
WARNING:   No rules found matching 'Context/environment'.
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Tomcat\webapps\docs
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Tomcat\webapps\host-manager
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Tomcat\webapps\manager
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Tomcat\webapps\ROOT
aug 14, 2013 11:20:54 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
aug 14, 2013 11:20:54 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1838 ms

关于如何修复它或需要研究什么的任何想法?

最佳答案

我会添加评论,但没有声誉 :(

你 checkout 了吗:

solr dataimport error: Indexing failed. Rolled back all changes

SOLR: Indexing failed. Rolled back all changes.

http://mail-archives.apache.org/mod_mbox/lucene-solr-user/200912.mbox/%3C26676982.post@talk.nabble.com%3E

您收到警告“SimplePropertiesWriter 无法读取:dataimport.properties”,一个建议是在您的 conf 目录中创建一个名为 dataimport.properties 的空白文件,并且不要忘记确保系统对它具有写入权限.

关于apache - Solr - DataImportHandler : Indexing failed. 回滚所有更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18228922/

相关文章:

apache - 将所有 URL 重定向到 httpd.conf 中的单个页面

apache - HTTPS 自动重新路由到生产服务器而不是开发服务器

tomcat - Openshift tomcat,无法找到 server.xml 和 context.xml?

java - Solrj 从字符串创建查询

java - 打开lucene索引时出错: java. io.IOException:映射失败

php - 如何在查询时删除solr中的动态字段后缀,如_i,_ txt?

apache - 将参数url重写为普通url,但重定向后应该获取原始url参数

java - 无法在 apache tomcat 上运行 servlet。它说,请求的资源不可用

java - java主机上的堆空间

mysql - 错误消息 : Unable to get connection, 数据源无效: "java.sql.SQLException: Cannot create JDBC driver of class ' ' 对于连接 URL 'null' ”