# \[JDBC River\] MySQL - 'connection refused' breaks river due to NullPointerException

**URL:** <https://discuss.elastic.co/t/jdbc-river-mysql-connection-refused-breaks-river-due-to-nullpointerexception/11340>\
**Category:** Elasticsearch\
**Created:** [March 27, 2013, 4:33pm UTC](https://discuss.elastic.co/t/jdbc-river-mysql-connection-refused-breaks-river-due-to-nullpointerexception/11340 "2013-03-27T16:33:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomislav\_Poljak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomislav_poljak/32/1177_2.png) [@Tomislav\_Poljak](https://discuss.elastic.co/u/Tomislav_Poljak)\
**Post date:** [March 27, 2013, 4:33pm UTC](https://discuss.elastic.co/t/jdbc-river-mysql-connection-refused-breaks-river-due-to-nullpointerexception/11340/1 "2013-03-27T16:33:51Z")

</div>

Hi,  
when using JDBC River's 'simple' strategy (with 'poll' reindexing  
configured) on MySQL (5.5), if connection to the database is not  
available on one reindexing attempt with exception

[ERROR][org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource]  
while opening read connection: jdbc:mysql://databaseXY Communications  
link failure  
....  
Caused by: java.net.ConnectException: Connection refused  
...

this causes NullPointerException in jdbc river:

ERROR][org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow]  
java.lang.NullPointerException  
at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.executeQuery(SimpleRiverSource.java:409)  
at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:238)  
at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.move(SimpleRiverFlow.java:181)  
at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.run(SimpleRiverFlow.java:139)  
at java.lang.Thread.run(Thread.java:662)

which breaks the river in sense that next scheduled  
reindexing/re-import will not occur later/again, even if database  
becomes available (seems this is due to unhandled NPE caused by null  
Connection from connectionForReading(); which then breaks the river)

ElasticSearch version is 0.90.0.Beta1+ and plugin version is 2.2.0

Thanks,

Tomislav

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 28, 2013, 2:45pm UTC](https://discuss.elastic.co/t/jdbc-river-mysql-connection-refused-breaks-river-due-to-nullpointerexception/11340/2 "2013-03-28T14:45:42Z")

</div>

Thanks for reporting!

I opened an issue

> <https://github.com/jprante/elasticsearch-jdbc/issues/72>
>
> when using JDBC River's 'simple' strategy (with 'poll' reindexing
> configured) on… MySQL (5.5), if connection to the database is not
> available on one reindexing attempt with exception
> 
> \[ERROR\]\[org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource\]
> while opening read connection: jdbc:mysql://databaseXY Communications
> link failure
> ....
> Caused by: java.net.ConnectException: Connection refused
> ...
> 
> this causes NullPointerException in jdbc river:
> 
> ERROR\]\[org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow\]
> java.lang.NullPointerException
> at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.executeQuery(SimpleRiverSource.java:409)
> at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:238)
> at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.move(SimpleRiverFlow.java:181)
> at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.run(SimpleRiverFlow.java:139)
> at java.lang.Thread.run(Thread.java:662)
> 
> which breaks the river in sense that next scheduled
> reindexing/re-import will not occur later/again, even if database
> becomes available (seems this is due to unhandled NPE caused by null
> Connection from connectionForReading(); which then breaks the river)
> 
> ElasticSearch version is 0.90.0.Beta1+ and plugin version is 2.2.0

Jörg

Am 27.03.13 17:33, schrieb Tomislav Poljak:

> Hi,  
> when using JDBC River's 'simple' strategy (with 'poll' reindexing  
> configured) on MySQL (5.5), if connection to the database is not  
> available on one reindexing attempt with exception
> 
> [ERROR][org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource]  
> while opening read connection: jdbc:mysql://databaseXY Communications  
> link failure  
> ....  
> Caused by: java.net.ConnectException: Connection refused  
> ...
> 
> this causes NullPointerException in jdbc river:
> 
> ERROR][org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow]  
> java.lang.NullPointerException  
> at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.executeQuery(SimpleRiverSource.java:409)  
> at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:238)  
> at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.move(SimpleRiverFlow.java:181)  
> at org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.run(SimpleRiverFlow.java:139)  
> at java.lang.Thread.run(Thread.java:662)
> 
> which breaks the river in sense that next scheduled  
> reindexing/re-import will not occur later/again, even if database  
> becomes available (seems this is due to unhandled NPE caused by null  
> Connection from connectionForReading(); which then breaks the river)
> 
> Elasticsearch version is 0.90.0.Beta1+ and plugin version is 2.2.0
> 
> Thanks,
> 
> Tomislav
> 
> -- You received this message because you are subscribed to the Google  
> Groups "elasticsearch" group. To unsubscribe from this group and stop  
> receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com). For more options, visit  
> [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:43am UTC](https://discuss.elastic.co/t/jdbc-river-mysql-connection-refused-breaks-river-due-to-nullpointerexception/11340/3 "2017-07-06T02:43:51Z")

</div>

Closed on July 6, 2017, 2:43am UTC


