Domanda

I'm running Solr 4.4 under Tomcat on a Windows environment. I have set up DataImportHandler and tried to fetch data from a SQL Server Express 2012. TCP/IP is enabled on the SQL Server instance.

When I run the index routine (http://server.com:8080/solr/dataimport?command=full-import) I get the error "Indexing failed. Rolled back all changes."

Response

<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>

Logline from Solr admin interface

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

solrconfig.xml requestHandler

<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> 

Catalina log

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

Any idea on how to fix it or what to look into?

È stato utile?

Soluzione

I would add a comment but dont have the reputation :(

Have you checked out:

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

You are getting a warning "SimplePropertiesWriter Unable to read: dataimport.properties", one suggestion was to create a blank file called dataimport.properties in your conf directory and don't forget to make sure the system has write access to it.

Altri suggerimenti

Does the file dataimport.properties exist and check that it isn't write protected.

I found this in the wiki

When full-import command is executed, it stores the start time of the operation in a file located at conf/dataimport.properties (this file is configurable)

Read more http://wiki.apache.org/solr/DataImportHandler#Commands

I had this problem - restarting tomcat solved it...so: service tomcat7 restart

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top