# River-jdbc Error java.lang.NullPointerException

**URL:** <https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457>\
**Category:** Elasticsearch\
**Created:** [January 2, 2015, 6:05pm UTC](https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457 "2015-01-02T18:05:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garrett\_Johnson](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Garrett\_Johnson](https://discuss.elastic.co/u/Garrett_Johnson)\
**Post date:** [January 2, 2015, 6:05pm UTC](https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457/1 "2015-01-02T18:05:03Z")

</div>

Hi All,

I have set up ElasticSearch 1.4.2 and river-jdbc from jprante. I was able  
to add a river using sense

put \_river/users/\_meta  
{  
"type":"jdbc",  
"jdbc": {

"url":"jdbc:sqlserver://My.SQLSever.mydomain.com:1433;databaseName=webrepos;integratedSecurity=true;","sql":"SELECT

- FROM [Webrepos].[dbo].[User]"  
}  
}

This takes but then in the logs I'm getting this:

2015-01-02 11:17:04,829][INFO][river.jdbc.RiverMetrics] pipeline  
org.xbib.elasticsearch.plugin.jdbc.RiverPipeline@730a6f3 complete: river  
jdbc/users metrics: 0 rows, 0.0 mean, (0.0 0.0 0.0), ingest metrics:  
elapsed 0 seconds, 0.0 bytes bytes, 0.0 bytes avg, 0 MB/s  
[2015-01-02 11:17:04,808][ERROR][river.jdbc.RiverPipeline]  
java.lang.NullPointerException  
java.io.IOException: java.lang.NullPointerException  
at  
org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:341)  
at  
org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.fetch(SimpleRiverFlow.java:220)  
at  
org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.execute(SimpleRiverFlow.java:149)  
at  
org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.request(RiverPipeline.java:88)  
at  
org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:66)  
at  
org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:30)  
at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:744)  
Caused by: java.lang.NullPointerException  
at java.util.Hashtable.put(Hashtable.java:514)  
at  
org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.getConnectionForReading(SimpleRiverSource.java:212)  
at  
org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.execute(SimpleRiverSource.java:376)  
at  
org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:320)  
... 9 more

I am using integrated security and the Service is running as an account  
that has access to the DB as well as the elasticsearch folders. We have  
other services on the same machine that use the same account and am not  
getting Connection refused errors.

Any ideas?

It doesn't appear that it is getting any actual data from the database.  
Not sure how to check that other than a search query which is returning no  
results.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [January 2, 2015, 6:19pm UTC](https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457/2 "2015-01-02T18:19:17Z")

</div>

Thanks for report, I have opened an issue for that

> <https://github.com/jprante/elasticsearch-jdbc/issues/430>
>
> I have set up ElasticSearch 1.4.2 and river-jdbc from jprante. I was able 
> to a…dd a river using sense
> 
> put \_river/users/\_meta
> {
> "type":"jdbc",
> "jdbc": {
> 
> "url":"jdbc:sqlserver://My.SQLSever.mydomain.com:1433;databaseName=webrepos;integratedSecurity=true;","sql":"SELECT 
> \- FROM \[Webrepos\].\[dbo\].\[User\]"
> }
> }
> 
> This takes but then in the logs I'm getting this:
> 
> 2015-01-02 11:17:04,829\]\[INFO \]\[river.jdbc.RiverMetrics \] pipeline 
> org.xbib.elasticsearch.plugin.jdbc.RiverPipeline@730a6f3 complete: river 
> jdbc/users metrics: 0 rows, 0.0 mean, (0.0 0.0 0.0), ingest metrics: 
> elapsed 0 seconds, 0.0 bytes bytes, 0.0 bytes avg, 0 MB/s
> \[2015-01-02 11:17:04,808\]\[ERROR\]\[river.jdbc.RiverPipeline \] 
> java.lang.NullPointerException
> java.io.IOException: java.lang.NullPointerException
> at 
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:341)
> at 
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.fetch(SimpleRiverFlow.java:220)
> at 
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.execute(SimpleRiverFlow.java:149)
> at 
> org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.request(RiverPipeline.java:88)
> at 
> org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:66)
> at 
> org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:30)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:744)
> Caused by: java.lang.NullPointerException
> at java.util.Hashtable.put(Hashtable.java:514)
> at 
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.getConnectionForReading(SimpleRiverSource.java:212)
> at 
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.execute(SimpleRiverSource.java:376)
> at 
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:320)
> ... 9 more
> 
> I am using integrated security and the Service is running as an account 
> that has access to the DB as well as the elasticsearch folders. We have 
> other services on the same machine that use the same account and am not 
> getting Connection refused errors.
> 
> Any ideas?
> 
> It doesn't appear that it is getting any actual data from the database. 
> Not sure how to check that other than a search query which is returning no 
> results.

Do you connect without a user name to JDBC? The error is caused because you  
did not pass a user name as parameter.

Jörg

On Fri, Jan 2, 2015 at 7:05 PM, Garrett Johnson [garrettcjohnson@gmail.com](mailto:garrettcjohnson@gmail.com)  
wrote:

> Hi All,
> 
> I have set up Elasticsearch 1.4.2 and river-jdbc from jprante. I was able  
> to add a river using sense
> 
> put \_river/users/\_meta  
> {  
> "type":"jdbc",  
> "jdbc": {  
> "url":"jdbc:sqlserver://My.SQLSever.mydomain.com:1433;databaseName=webrepos;integratedSecurity=true;","sql":"SELECT
> 
> - FROM [Webrepos].[dbo].[User]"  
> }  
> }
> 
> This takes but then in the logs I'm getting this:
> 
> 2015-01-02 11:17:04,829][INFO][river.jdbc.RiverMetrics] pipeline  
> org.xbib.elasticsearch.plugin.jdbc.RiverPipeline@730a6f3 complete: river  
> jdbc/users metrics: 0 rows, 0.0 mean, (0.0 0.0 0.0), ingest metrics:  
> elapsed 0 seconds, 0.0 bytes bytes, 0.0 bytes avg, 0 MB/s  
> [2015-01-02 11:17:04,808][ERROR][river.jdbc.RiverPipeline]  
> java.lang.NullPointerException  
> java.io.IOException: java.lang.NullPointerException  
> at  
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:341)  
> at  
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.fetch(SimpleRiverFlow.java:220)  
> at  
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.execute(SimpleRiverFlow.java:149)  
> at  
> org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.request(RiverPipeline.java:88)  
> at  
> org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:66)  
> at  
> org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:30)  
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:744)  
> Caused by: java.lang.NullPointerException  
> at java.util.Hashtable.put(Hashtable.java:514)  
> at  
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.getConnectionForReading(SimpleRiverSource.java:212)  
> at  
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.execute(SimpleRiverSource.java:376)  
> at  
> org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:320)  
> ... 9 more
> 
> I am using integrated security and the Service is running as an account  
> that has access to the DB as well as the elasticsearch folders. We have  
> other services on the same machine that use the same account and am not  
> getting Connection refused errors.
> 
> Any ideas?
> 
> It doesn't appear that it is getting any actual data from the database.  
> Not sure how to check that other than a search query which is returning no  
> results.
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG2093T%2B1UrtgnrUYjwX89TLS0M05uvMrWzvQ3\_UY%2BMpw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG2093T%2B1UrtgnrUYjwX89TLS0M05uvMrWzvQ3_UY%2BMpw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Garrett\_Johnson](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Garrett\_Johnson](https://discuss.elastic.co/u/Garrett_Johnson)\
**Post date:** [January 2, 2015, 7:52pm UTC](https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457/3 "2015-01-02T19:52:57Z")

</div>

Yes because a user name is not required for Integrated security.

I have to get security exceptions to use SQL Auth instead of integrated.

On Friday, January 2, 2015 12:19:24 PM UTC-6, Jörg Prante wrote:

> Thanks for report, I have opened an issue for that
> 
> [NPE in getConnectionForReading · Issue #430 · jprante/elasticsearch-jdbc · GitHub](https://github.com/jprante/elasticsearch-river-jdbc/issues/430)
> 
> Do you connect without a user name to JDBC? The error is caused because  
> you did not pass a user name as parameter.
> 
> Jörg
> 
> On Fri, Jan 2, 2015 at 7:05 PM, Garrett Johnson \<[garrett...@gmail.com](mailto:garrett...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi All,
> > 
> > I have set up Elasticsearch 1.4.2 and river-jdbc from jprante. I was  
> > able to add a river using sense
> > 
> > put \_river/users/\_meta  
> > {  
> > "type":"jdbc",  
> > "jdbc": {
> > 
> > "url":"jdbc:sqlserver://My.SQLSever.mydomain.com:1433;databaseName=webrepos;integratedSecurity=true;","sql":"SELECT
> > 
> > - FROM [Webrepos].[dbo].[User]"  
> > }  
> > }
> > 
> > This takes but then in the logs I'm getting this:
> > 
> > 2015-01-02 11:17:04,829][INFO][river.jdbc.RiverMetrics] pipeline  
> > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline@730a6f3 complete: river  
> > jdbc/users metrics: 0 rows, 0.0 mean, (0.0 0.0 0.0), ingest metrics:  
> > elapsed 0 seconds, 0.0 bytes bytes, 0.0 bytes avg, 0 MB/s  
> > [2015-01-02 11:17:04,808][ERROR][river.jdbc.RiverPipeline]  
> > java.lang.NullPointerException  
> > java.io.IOException: java.lang.NullPointerException  
> > at  
> > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:341)  
> > at  
> > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.fetch(SimpleRiverFlow.java:220)  
> > at  
> > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.execute(SimpleRiverFlow.java:149)  
> > at  
> > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.request(RiverPipeline.java:88)  
> > at  
> > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:66)  
> > at  
> > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:30)  
> > at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> > at java.lang.Thread.run(Thread.java:744)  
> > Caused by: java.lang.NullPointerException  
> > at java.util.Hashtable.put(Hashtable.java:514)  
> > at  
> > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.getConnectionForReading(SimpleRiverSource.java:212)  
> > at  
> > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.execute(SimpleRiverSource.java:376)  
> > at  
> > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:320)  
> > ... 9 more
> > 
> > I am using integrated security and the Service is running as an account  
> > that has access to the DB as well as the elasticsearch folders. We have  
> > other services on the same machine that use the same account and am not  
> > getting Connection refused errors.
> > 
> > Any ideas?
> > 
> > It doesn't appear that it is getting any actual data from the database.  
> > Not sure how to check that other than a search query which is returning no  
> > results.
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f810256d-00de-4d91-98f3-cf3fa9a89636%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f810256d-00de-4d91-98f3-cf3fa9a89636%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Garrett\_Johnson](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Garrett\_Johnson](https://discuss.elastic.co/u/Garrett_Johnson)\
**Post date:** [January 2, 2015, 8:10pm UTC](https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457/4 "2015-01-02T20:10:44Z")

</div>

I used this type of string here:

jdbc:sqlserver://localhost;databaseName=AdventureWorks;integratedSecurity=true;

like here:

> **[Building the connection URL - JDBC Driver for SQL Server](https://learn.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver16&redirectedfrom=MSDN)**
>
> Article about formatting the connection string used by the Microsoft JDBC Driver for SQL Server. Samples of connection strings are included in the examples section.

Will try to connect with username and password blank.

On Friday, January 2, 2015 1:52:58 PM UTC-6, Garrett Johnson wrote:

> Yes because a user name is not required for Integrated security.
> 
> I have to get security exceptions to use SQL Auth instead of integrated.
> 
> On Friday, January 2, 2015 12:19:24 PM UTC-6, Jörg Prante wrote:
> 
> > Thanks for report, I have opened an issue for that
> > 
> > [NPE in getConnectionForReading · Issue #430 · jprante/elasticsearch-jdbc · GitHub](https://github.com/jprante/elasticsearch-river-jdbc/issues/430)
> > 
> > Do you connect without a user name to JDBC? The error is caused because  
> > you did not pass a user name as parameter.
> > 
> > Jörg
> > 
> > On Fri, Jan 2, 2015 at 7:05 PM, Garrett Johnson [garrett...@gmail.com](mailto:garrett...@gmail.com)  
> > wrote:
> > 
> > > Hi All,
> > > 
> > > I have set up Elasticsearch 1.4.2 and river-jdbc from jprante. I was  
> > > able to add a river using sense
> > > 
> > > put \_river/users/\_meta  
> > > {  
> > > "type":"jdbc",  
> > > "jdbc": {
> > > 
> > > "url":"jdbc:sqlserver://My.SQLSever.mydomain.com:1433;databaseName=webrepos;integratedSecurity=true;","sql":"SELECT
> > > 
> > > - FROM [Webrepos].[dbo].[User]"  
> > > }  
> > > }
> > > 
> > > This takes but then in the logs I'm getting this:
> > > 
> > > 2015-01-02 11:17:04,829][INFO][river.jdbc.RiverMetrics] pipeline  
> > > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline@730a6f3 complete: river  
> > > jdbc/users metrics: 0 rows, 0.0 mean, (0.0 0.0 0.0), ingest metrics:  
> > > elapsed 0 seconds, 0.0 bytes bytes, 0.0 bytes avg, 0 MB/s  
> > > [2015-01-02 11:17:04,808][ERROR][river.jdbc.RiverPipeline]  
> > > java.lang.NullPointerException  
> > > java.io.IOException: java.lang.NullPointerException  
> > > at  
> > > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:341)  
> > > at  
> > > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.fetch(SimpleRiverFlow.java:220)  
> > > at  
> > > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.execute(SimpleRiverFlow.java:149)  
> > > at  
> > > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.request(RiverPipeline.java:88)  
> > > at  
> > > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:66)  
> > > at  
> > > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:30)  
> > > at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
> > > at  
> > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> > > at  
> > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> > > at java.lang.Thread.run(Thread.java:744)  
> > > Caused by: java.lang.NullPointerException  
> > > at java.util.Hashtable.put(Hashtable.java:514)  
> > > at  
> > > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.getConnectionForReading(SimpleRiverSource.java:212)  
> > > at  
> > > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.execute(SimpleRiverSource.java:376)  
> > > at  
> > > org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:320)  
> > > ... 9 more
> > > 
> > > I am using integrated security and the Service is running as an account  
> > > that has access to the DB as well as the elasticsearch folders. We have  
> > > other services on the same machine that use the same account and am not  
> > > getting Connection refused errors.
> > > 
> > > Any ideas?
> > > 
> > > It doesn't appear that it is getting any actual data from the database.  
> > > Not sure how to check that other than a search query which is returning no  
> > > results.
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [January 2, 2015, 9:06pm UTC](https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457/5 "2015-01-02T21:06:20Z")

</div>

I pushed out JDBC plugin version 1.4.0.8 with a fix. Thanks for the report.

Jörg

On Fri, Jan 2, 2015 at 9:10 PM, Garrett Johnson [garrettcjohnson@gmail.com](mailto:garrettcjohnson@gmail.com)  
wrote:

> I used this type of string here:
> 
> jdbc:sqlserver://localhost;databaseName=AdventureWorks;integratedSecurity=true;
> 
> like here:
> 
> [Building the connection URL - JDBC Driver for SQL Server | Microsoft Learn](http://msdn.microsoft.com/en-us/library/ms378428%28v=sql.110%29.aspx)
> 
> Will try to connect with username and password blank.
> 
> On Friday, January 2, 2015 1:52:58 PM UTC-6, Garrett Johnson wrote:
> 
> > Yes because a user name is not required for Integrated security.
> > 
> > I have to get security exceptions to use SQL Auth instead of integrated.
> > 
> > On Friday, January 2, 2015 12:19:24 PM UTC-6, Jörg Prante wrote:
> > 
> > > Thanks for report, I have opened an issue for that
> > > 
> > > [NPE in getConnectionForReading · Issue #430 · jprante/elasticsearch-jdbc · GitHub](https://github.com/jprante/elasticsearch-river-jdbc/issues/430)
> > > 
> > > Do you connect without a user name to JDBC? The error is caused because  
> > > you did not pass a user name as parameter.
> > > 
> > > Jörg
> > > 
> > > On Fri, Jan 2, 2015 at 7:05 PM, Garrett Johnson [garrett...@gmail.com](mailto:garrett...@gmail.com)  
> > > wrote:
> > > 
> > > > Hi All,
> > > > 
> > > > I have set up Elasticsearch 1.4.2 and river-jdbc from jprante. I was  
> > > > able to add a river using sense
> > > > 
> > > > put \_river/users/\_meta  
> > > > {  
> > > > "type":"jdbc",  
> > > > "jdbc": {  
> > > > "url":"jdbc:sqlserver://My.SQLSever.mydomain.com:1433;  
> > > > databaseName=webrepos;integratedSecurity=true;","sql":"SELECT \* FROM  
> > > > [Webrepos].[dbo].[User]"  
> > > > }  
> > > > }
> > > > 
> > > > This takes but then in the logs I'm getting this:
> > > > 
> > > > 2015-01-02 11:17:04,829][INFO][river.jdbc.RiverMetrics] pipeline  
> > > > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline@730a6f3 complete:  
> > > > river jdbc/users metrics: 0 rows, 0.0 mean, (0.0 0.0 0.0), ingest metrics:  
> > > > elapsed 0 seconds, 0.0 bytes bytes, 0.0 bytes avg, 0 MB/s  
> > > > [2015-01-02 11:17:04,808][ERROR][river.jdbc.RiverPipeline]  
> > > > java.lang.NullPointerException  
> > > > java.io.IOException: java.lang.NullPointerException  
> > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > SimpleRiverSource.fetch(SimpleRiverSource.java:341)  
> > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > SimpleRiverFlow.fetch(SimpleRiverFlow.java:220)  
> > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > SimpleRiverFlow.execute(SimpleRiverFlow.java:149)  
> > > > at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.request(  
> > > > RiverPipeline.java:88)  
> > > > at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(  
> > > > RiverPipeline.java:66)  
> > > > at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(  
> > > > RiverPipeline.java:30)  
> > > > at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
> > > > at java.util.concurrent.ThreadPoolExecutor.runWorker(  
> > > > ThreadPoolExecutor.java:1145)  
> > > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
> > > > ThreadPoolExecutor.java:615)  
> > > > at java.lang.Thread.run(Thread.java:744)  
> > > > Caused by: java.lang.NullPointerException  
> > > > at java.util.Hashtable.put(Hashtable.java:514)  
> > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.  
> > > > getConnectionForReading(SimpleRiverSource.java:212)  
> > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > SimpleRiverSource.execute(SimpleRiverSource.java:376)  
> > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > SimpleRiverSource.fetch(SimpleRiverSource.java:320)  
> > > > ... 9 more
> > > > 
> > > > I am using integrated security and the Service is running as an account  
> > > > that has access to the DB as well as the elasticsearch folders. We have  
> > > > other services on the same machine that use the same account and am not  
> > > > getting Connection refused errors.
> > > > 
> > > > Any ideas?
> > > > 
> > > > It doesn't appear that it is getting any actual data from the  
> > > > database. Not sure how to check that other than a search query which is  
> > > > returning no results.
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > 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).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGqGg2\_F-%2BKPSCLEEzOtGyDg1a\_%3Dxn3isX48Xpi9ubKoA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGqGg2_F-%2BKPSCLEEzOtGyDg1a_%3Dxn3isX48Xpi9ubKoA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Garrett\_Johnson](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Garrett\_Johnson](https://discuss.elastic.co/u/Garrett_Johnson)\
**Post date:** [January 7, 2015, 3:36am UTC](https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457/6 "2015-01-07T03:36:32Z")

</div>

Ok so i got the 1.4.0.8.

When that happened I got an error saying that Integrated Security was not  
supported with this driver.

I had to put sqljdbc\_auth.dll into they system path variables.

After that it started to work. Windows Auth only!!

Thanks for the help.

On Friday, January 2, 2015 3:06:28 PM UTC-6, Jörg Prante wrote:

> I pushed out JDBC plugin version 1.4.0.8 with a fix. Thanks for the report.
> 
> Jörg
> 
> On Fri, Jan 2, 2015 at 9:10 PM, Garrett Johnson \<[garrett...@gmail.com](mailto:garrett...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > I used this type of string here:
> > 
> > jdbc:sqlserver://localhost;databaseName=AdventureWorks;integratedSecurity=true;
> > 
> > like here:
> > 
> > [Building the connection URL - JDBC Driver for SQL Server | Microsoft Learn](http://msdn.microsoft.com/en-us/library/ms378428%28v=sql.110%29.aspx)
> > 
> > Will try to connect with username and password blank.
> > 
> > On Friday, January 2, 2015 1:52:58 PM UTC-6, Garrett Johnson wrote:
> > 
> > > Yes because a user name is not required for Integrated security.
> > > 
> > > I have to get security exceptions to use SQL Auth instead of integrated.
> > > 
> > > On Friday, January 2, 2015 12:19:24 PM UTC-6, Jörg Prante wrote:
> > > 
> > > > Thanks for report, I have opened an issue for that
> > > > 
> > > > [NPE in getConnectionForReading · Issue #430 · jprante/elasticsearch-jdbc · GitHub](https://github.com/jprante/elasticsearch-river-jdbc/issues/430)
> > > > 
> > > > Do you connect without a user name to JDBC? The error is caused because  
> > > > you did not pass a user name as parameter.
> > > > 
> > > > Jörg
> > > > 
> > > > On Fri, Jan 2, 2015 at 7:05 PM, Garrett Johnson [garrett...@gmail.com](mailto:garrett...@gmail.com)  
> > > > wrote:
> > > > 
> > > > > Hi All,
> > > > > 
> > > > > I have set up Elasticsearch 1.4.2 and river-jdbc from jprante. I was  
> > > > > able to add a river using sense
> > > > > 
> > > > > put \_river/users/\_meta  
> > > > > {  
> > > > > "type":"jdbc",  
> > > > > "jdbc": {  
> > > > > "url":"jdbc:sqlserver://My.SQLSever.mydomain.com:1433;  
> > > > > databaseName=webrepos;integratedSecurity=true;","sql":"SELECT \* FROM  
> > > > > [Webrepos].[dbo].[User]"  
> > > > > }  
> > > > > }
> > > > > 
> > > > > This takes but then in the logs I'm getting this:
> > > > > 
> > > > > 2015-01-02 11:17:04,829][INFO][river.jdbc.RiverMetrics] pipeline  
> > > > > org.xbib.elasticsearch.plugin.jdbc.RiverPipeline@730a6f3 complete:  
> > > > > river jdbc/users metrics: 0 rows, 0.0 mean, (0.0 0.0 0.0), ingest metrics:  
> > > > > elapsed 0 seconds, 0.0 bytes bytes, 0.0 bytes avg, 0 MB/s  
> > > > > [2015-01-02 11:17:04,808][ERROR][river.jdbc.RiverPipeline]  
> > > > > java.lang.NullPointerException  
> > > > > java.io.IOException: java.lang.NullPointerException  
> > > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > > SimpleRiverSource.fetch(SimpleRiverSource.java:341)  
> > > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > > SimpleRiverFlow.fetch(SimpleRiverFlow.java:220)  
> > > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > > SimpleRiverFlow.execute(SimpleRiverFlow.java:149)  
> > > > > at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.request(  
> > > > > RiverPipeline.java:88)  
> > > > > at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(  
> > > > > RiverPipeline.java:66)  
> > > > > at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(  
> > > > > RiverPipeline.java:30)  
> > > > > at java.util.concurrent.FutureTask.run(FutureTask.java:262)  
> > > > > at java.util.concurrent.ThreadPoolExecutor.runWorker(  
> > > > > ThreadPoolExecutor.java:1145)  
> > > > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
> > > > > ThreadPoolExecutor.java:615)  
> > > > > at java.lang.Thread.run(Thread.java:744)  
> > > > > Caused by: java.lang.NullPointerException  
> > > > > at java.util.Hashtable.put(Hashtable.java:514)  
> > > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > > SimpleRiverSource.getConnectionForReading(SimpleRiverSource.java:212)  
> > > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > > SimpleRiverSource.execute(SimpleRiverSource.java:376)  
> > > > > at org.xbib.elasticsearch.river.jdbc.strategy.simple.  
> > > > > SimpleRiverSource.fetch(SimpleRiverSource.java:320)  
> > > > > ... 9 more
> > > > > 
> > > > > I am using integrated security and the Service is running as an  
> > > > > account that has access to the DB as well as the elasticsearch folders. We  
> > > > > have other services on the same machine that use the same account and am  
> > > > > not getting Connection refused errors.
> > > > > 
> > > > > Any ideas?
> > > > > 
> > > > > It doesn't appear that it is getting any actual data from the  
> > > > > database. Not sure how to check that other than a search query which is  
> > > > > returning no results.
> > > > > 
> > > > > --  
> > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%  
> > > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b217c635-915f-4030-9d2d-3fa50419d266%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c32b51d9-c1f1-43a4-83c4-a3bed0d022fa%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5517fad4-0f62-45f5-956b-0139da14902c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5517fad4-0f62-45f5-956b-0139da14902c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:40am UTC](https://discuss.elastic.co/t/river-jdbc-error-java-lang-nullpointerexception/21457/7 "2017-07-06T00:40:24Z")

</div>


