Hi,

I am getting this error with DIH using a combination of SQLEntityProcessor
and XPathEntityProcessor:
Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException:
Unable to execute query: null Processing Document # 1
        at
org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:71)
 ...
Caused by: java.sql.SQLException: SQL statement to execute cannot be empty
or null
...

when I debug the DataImport code, I see that the wrong datasource is being
picked up by XPathEntityProcessor. It would always pick up JDBCDataSource
even though I have configured it to use FieldReaderDataSource. Below is how
my data-config file looks like

<dataConfig>
        <dataSource name="globalDS"
                                type="JdbcDataSource"
                                driver="oracle.jdbc.driver.OracleDriver" 
                                url="jdbc:oracle:thin:@//host:port/dbname" 
                                user="foo" 
                                password="foo" />
        <datasource name="fieldSource"
                                type="FieldReaderDataSource" />
        <datasource name="filesource"
                                type="FileDataSource" />
        
    <document name="doc">
        <entity name="parent" dataSource="globalDS" query="select * from
PARENT_TBL where PARENT_ID=1">
            <field column="PARENT_ID" name="id" />
            <field column="PARENT_NAME" name="Parent_Name" />
            
            <entity name="child"
                                        dataSource="globalDS"
                                        query="select XML from CHILD_TBL where 
PARENT_ID=1"
                                        transformer="ClobTransformer">
                                <field column="XML" name="Message" clob="true" 
/>
                                
                                <entity name="child_xml"
                                                rootEntity="true"
                                                dataSource="fieldSource" 
                                                dataField="child.Message" 
                                                
processor="XPathEntityProcessor" forEach="/children/child">
                                        <field column="Child_Name" 
xpath="/children/child/Child_Name" />
                                        <field column="Child_Age" 
xpath="/children/child/Child_Age" />
                                </entity>
                        </entity>
                </entity>
    </document>
</dataConfig>           

Appreciate any help.... thanks in advance.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/DIH-incorrect-datasource-being-picked-up-by-XPathEntityProcessor-tp3994802.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to