lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pattabiraman, Meenakshisundaram" <>
Subject RE: XPathentity processor on CLOB field
Date Thu, 18 Jun 2015 11:50:45 GMT

This is the error cause reported.  I also see that it has been reported earlier (
but could not find a solution.

I am nesting the FieldReaderDataSource within the Entity definition that has a CLOB field.
With this it fails only after transforming the clob. 
If I do not nest, I get this error when the FieldReaderDataSource is initialized thus failing
even before the SQL is executed.
Either case, the error is happening at the same place. 

Caused by: java.sql.SQLException: SQL statement to execute cannot be empty or null
	at oracle.jdbc.driver.SQLStateMapping.newSQLException(
	at oracle.jdbc.driver.DatabaseError.newSQLException(
	at oracle.jdbc.driver.DatabaseError.throwSqlException(
	at oracle.jdbc.driver.DatabaseError.throwSqlException(
	at oracle.jdbc.driver.DatabaseError.throwSqlException(
	at oracle.jdbc.driver.OracleSql.initialize(
	at oracle.jdbc.driver.OracleStatement.executeInternal(
	at oracle.jdbc.driver.OracleStatement.execute(
	at oracle.jdbc.driver.OracleStatementWrapper.execute(
	at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(
	... 14 more

Pattabi Meenakshisundaram

-----Original Message-----
From: Pattabiraman, Meenakshisundaram [] 
Sent: Wednesday, June 17, 2015 9:33 PM
To: ''
Subject: XPathentity processor on CLOB field

My requirement is to read the XML from a CLOB field and parse it to get the entity.

The data config is as shown below. I am trying to map two fields 'event' and 'policyNumber'
for the entity 'catreport'.

<dataSource name="mbdev" driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:orcl"
user="xyz" password="xyz"/> <document name="insight">
            <entity name="input" query="select * from test" logLevel="debug" datasource="mbdev"
transformer="ClobTransformer, script:toDate">
            <field column="LOAD_DATE" name="load_date" />

            <field column="RESPONSE_XML" name="RESPONSE_XML" clob="true" /> <dataSource
name="xmldata" type="FieldReaderDataSource"/>

            <entity name="catReport" dataSource="xmldata" dataField="input.RESPONSE_XML"
processor="XPathEntityProcessor"  forEach="/*:DecisionServiceRs"  rootEntity="true" logLevel="debug">
                        <field column="event" xpath="/dec:DecisionServiceRs/@event"/>

I am getting this error

Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute
query: null Processing Document # 1
                at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(
                at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(
                at org.apache.solr.handler.dataimport.JdbcDataSource.getData(
                at org.apache.solr.handler.dataimport.JdbcDataSource.getData(
                at org.apache.solr.handler.dataimport.XPathEntityProcessor.initQuery(
                at org.apache.solr.handler.dataimport.XPathEntityProcessor.fetchNextRow(

I see that the Clob is getting converted to String correctly and the log has this entry where
xml is printed Exception while processing: input document : SolrInputDocument(fields: [RESPONSE_XML=<dec:Deci....

I do not know why the error is thrown at Jdbc when the Clob is converted to string and passed
to the FieldReader and do not know how to make this work.


View raw message