I guess there was a null field and the xml parser blows up
On Thu, Sep 10, 2009 at 3:06 PM, nourredine khadri <nourredin...@yahoo.com> wrote: > Hi, > > I'm new solR user and for the moment it suits almost all my needs :) > > I use a fresh nightly release (09/2009) and I index a > database table using dataImportHandler. > > I try to parse an xml content field from this table using XPathEntityProcessor > and FieldReaderDataSource. Everything works fine for the full-import. > > But when I try to use the delta import (i need incremental indexation) using > "deltaQuery" > and "deltaImportQuery", it does not work and i have a stack for each > field : > > 10 sept. 2009 11:12:26 > org.apache.solr.handler.dataimport.XPathEntityProcessor initQuery > ATTENTION: Parsing failed for xml, url:null rows processed:0 > java.lang.RuntimeException: java.lang.NullPointerException > at > org.apache.solr.handler.dataimport.XPathRecordReader.streamRecords(XPathRecordReader.java:92) > at > org.apache.solr.handler.dataimport.XPathEntityProcessor.initQuery(XPathEntityProcessor.java:282) > at > org.apache.solr.handler.dataimport.XPathEntityProcessor.fetchNextRow(XPathEntityProcessor.java:187) > at > org.apache.solr.handler.dataimport.XPathEntityProcessor.nextRow(XPathEntityProcessor.java:164) > at > org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:237) > at > org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:339) > at > org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:365) > at > org.apache.solr.handler.dataimport.DocBuilder.doDelta(DocBuilder.java:259) > at > org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:159) > at > org.apache.solr.handler.dataimport.DataImporter.doDeltaImport(DataImporter.java:354) > at > org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:395) > at > org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:372) > Caused by: java.lang.NullPointerException > at > com.ctc.wstx.io.ReaderBootstrapper.initialLoad(ReaderBootstrapper.java:245) > at > com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:132) > at > com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:543) > at > com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:604) > at > com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:660) > at > com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:331) > at > org.apache.solr.handler.dataimport.XPathRecordReader.streamRecords(XPathRecordReader.java:88) > ... 11 more > > > When I remove the "delta" queries or the XPathEntityProcessor block , it's ok. > > my data-config.xml : > > <dataConfig> > <dataSource > name="database" > type="JdbcDataSource" > driver="com.mysql.jdbc.Driver" > url="jdbc:mysql://xxx" > user="xxx" > password="xxx"/> > <dataSource > type="FieldReaderDataSource" name="fieldReader"/> > <document> > > <entity > name="document" > dataSource="database" > processor="SqlEntityProcessor" > pk="CONTENTID" > query="SELECT * FROM SEARCH" > deltaImportQuery="SELECT * FROM SEARCH WHERE > CONTENTID=${dataimporter.delta.CONTENTID}" > deltaQuery="SELECT CONTENTID FROM SEARCH WHERE DATESTATUS >>= UNIX_TIMESTAMP('${dataimporter.last_index_time}')"> > > <entity > name="xml_contenu" > dataSource="fieldReader" > processor="XPathEntityProcessor" > forEach="/Contenu" > dataField="document.XML" > onError="continue"> > <field > column="SurTitre" xpath="/Contenu/ArtCourt/SurTitre" > flatten="true"/> > <field > column="Titre" xpath="/Contenu/ArtCourt/Titre" > flatten="true"/> > <field > column="Chapeau" xpath="/Contenu/ArtCourt/Chapeau" > flatten="true"/> > <field > column="Auteur" xpath="/Contenu/ArtCourt/AuteurW" > flatten="true"/> > <field > column="Accroche" xpath="/Contenu/ArtCourt/Accroche" > flatten="true"/> > <field > column="TxtCourt" xpath="/Contenu/ArtCourt/TxtCourt" > flatten="true"/> > <field > column="Refs" xpath="/Contenu/ArtCourt/Refs" > flatten="true"/> > </entity> > </entity> > > </document> > > </dataConfig> > > the server query > :http://localhost:8080/apache-solr-nightly/dataimport?command=delta-import > > All fields are declared in the shema.xml > > Can someone help me? > > Nourredine > > > -- ----------------------------------------------------- Noble Paul | Principal Engineer| AOL | http://aol.com