[ 
https://issues.apache.org/jira/browse/SOLR-6599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14165567#comment-14165567
 ] 

Shawn Heisey commented on SOLR-6599:
------------------------------------

In JdbcDataSource#createConnectionFactory, in the part that defines the new 
Callable, there is no checking/handling for when the connection is null.  There 
is a "if (c != null)" check, but nothing that defines what happens if c *is* 
null.


> Wrong error logged on DIH connection problem
> --------------------------------------------
>
>                 Key: SOLR-6599
>                 URL: https://issues.apache.org/jira/browse/SOLR-6599
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 4.10.1
>         Environment: Debian Squeeze, Oracle-java-8, mysql-connector-5.1.28
>            Reporter: Thomas Lamy
>            Priority: Minor
>
> If I try a full import via DIH from a mysql server which is firewalled or 
> down, I get a misleading error message (see below, only SQL statement 
> shortened).
> I don't know Java very well, but I suspect the connection error is catched, 
> the connection handle is null, which in turn leads to the null pointer 
> exception at the end of the stack trace.
> {code}
> Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: 
> org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to 
> execute query: SELECT SenderID, ProviderID, `Name`, RefSenderID, CameraURL, 
> ChatURL, [.....] Processing Document # 1
>       at 
> org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:271)
>       at 
> org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:416)
>       at 
> org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:480)
>       at 
> org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:461)
> Caused by: java.lang.RuntimeException: 
> org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to 
> execute query: SELECT SenderID, ProviderID, `Name`, RefSenderID, CameraURL, 
> ChatURL, [...] Processing Document # 1
>       at 
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:417)
>       at 
> org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:330)
>       at 
> org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:232)
>       ... 3 more
> Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: 
> Unable to execute query: SELECT SenderID, ProviderID, `Name`, RefSenderID, 
> CameraURL, ChatURL, [...] Processing Document # 1
>       at 
> org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:71)
>       at 
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:283)
>       at 
> org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:240)
>       at 
> org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:44)
>       at 
> org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:59)
>       at 
> org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:73)
>       at 
> org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:243)
>       at 
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:476)
>       at 
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:415)
>       ... 5 more
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:271)
>       ... 12 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to