# Exception with posting jdbc river config

**URL:** <https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366>\
**Category:** Elasticsearch\
**Created:** [December 23, 2014, 10:18am UTC](https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366 "2014-12-23T10:18:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashutosh\_Parab](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Ashutosh\_Parab](https://discuss.elastic.co/u/Ashutosh_Parab)\
**Post date:** [December 23, 2014, 10:18am UTC](https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366/1 "2014-12-23T10:18:59Z")

</div>

I am trying to post jdbc river config using CURL -XPUT on Windows Xp. I  
want to transfer data from MS SQL database into Elastic Search. However I  
am getting some exceptions. My Elastic Search version is 1.0.1

C:\>curl -XPUT "[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" -d  
{"type":"jdbc","j  
dbc":{"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver","url":"jdbc:sqlser  
ver://LOCALHOST\SQLEXPRESS;databaseName=Report","user":  
"user","password":"password","sql":"select \* from [Report].[dbo  
].[abc]","index":"pkId","type":"bigint"}}

{"error":"MapperParsingException[failed to parse]; nested:  
JsonParseException[Un  
recognized token 'jdbc': was expecting ('true', 'false' or 'null')\n at  
[Source:  
[B@c7947e; line: 1, column: 12]]; ","status":400}  
C:\>

Can someone please check the syntax of my curl command?

--  
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/e6fdea56-ca5e-4905-a68b-042472a77fc1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e6fdea56-ca5e-4905-a68b-042472a77fc1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jason\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zhang/32/745_2.png) [@Jason\_Zhang](https://discuss.elastic.co/u/Jason_Zhang)\
**Post date:** [December 23, 2014, 10:44am UTC](https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366/2 "2014-12-23T10:44:47Z")

</div>

2 ways to post data using curl:

1. the data here need to be bracketed like `curl -XPUT '' -d '{ "foo": "bar" }'`
2. put the data into file, then `curl -XPUT '' -d @put.json`.

I think the second is preferred.

On Tue 23.23.14 02:18, Ashutosh Parab wrote:

> I am trying to post jdbc river config using CURL -XPUT on Windows Xp. I  
> want to transfer data from MS SQL database into Elastic Search. However I  
> am getting some exceptions. My Elastic Search version is 1.0.1
> 
> C:\>curl -XPUT "[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" -d  
> {"type":"jdbc","j  
> dbc":{"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver","url":"jdbc:sqlser  
> ver://LOCALHOST\SQLEXPRESS;databaseName=Report","user":  
> "user","password":"password","sql":"select \* from [Report].[dbo  
> ].[abc]","index":"pkId","type":"bigint"}}
> 
> {"error":"MapperParsingException[failed to parse]; nested:  
> JsonParseException[Un  
> recognized token 'jdbc': was expecting ('true', 'false' or 'null')\n at  
> [Source:  
> [B@c7947e; line: 1, column: 12]]; ","status":400}  
> C:\>
> 
> Can someone please check the syntax of my curl command?
> 
> --  
> 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/e6fdea56-ca5e-4905-a68b-042472a77fc1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e6fdea56-ca5e-4905-a68b-042472a77fc1%40googlegroups.com).  
> 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/20141223104447.GA24617%40Lain.routerbf573c.com](https://groups.google.com/d/msgid/elasticsearch/20141223104447.GA24617%40Lain.routerbf573c.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ashutosh\_Parab](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Ashutosh\_Parab](https://discuss.elastic.co/u/Ashutosh_Parab)\
**Post date:** [December 23, 2014, 11:25am UTC](https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366/3 "2014-12-23T11:25:38Z")

</div>

I have created a put.json file with the following contents:-

{  
"type":"jdbc",  
"jdbc":  
{"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver",

"url":"jdbc:sqlserver://LOCALHOST\SQLEXPRESS;databaseName=Report

\_ME",  
"user":"user",  
"password":"password","sql":"select \* from

[Report.[dbo].[abc]"  
}

}

I try to post config using the command _curl -XPUT  
"[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" -d put.json._

Got the below error:-  
C:\>curl -XPUT "[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" -d put.json  
{"error":"MapperParsingException[failed to parse]; nested:  
ElasticsearchParseExc  
eption[Failed to derive xcontent from (offset=0, length=8): [112, 117, 116,  
46,  
106, 115, 111, 110]]; ","status":400}

Please advice

On Tuesday, 23 December 2014 16:15:00 UTC+5:30, Jason Zhang wrote:

> 2 ways to post data using curl:
> 
> 1. the data here need to be bracketed like `curl -XPUT '' -d '{ "foo": "bar" }'`
> 2. put the data into file, then `curl -XPUT '' -d @put.json`.
> 
> I think the second is preferred.
> 
> On Tue 23.23.14 02:18, Ashutosh Parab wrote:
> 
> > I am trying to post jdbc river config using CURL -XPUT on Windows Xp. I  
> > want to transfer data from MS SQL database into Elastic Search. However  
> > I  
> > am getting some exceptions. My Elastic Search version is 1.0.1
> > 
> > C:\>curl -XPUT "[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" -d  
> > {"type":"jdbc","j
> 
> dbc":{"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver","url":"jdbc:sqlser
> 
> > ver://LOCALHOST\SQLEXPRESS;databaseName=Report","user":  
> > "user","password":"password","sql":"select \* from [Report].[dbo  
> > ].[abc]","index":"pkId","type":"bigint"}}
> > 
> > {"error":"MapperParsingException[failed to parse]; nested:  
> > JsonParseException[Un  
> > recognized token 'jdbc': was expecting ('true', 'false' or 'null')\n at  
> > [Source:  
> > [B@c7947e; line: 1, column: 12]]; ","status":400}  
> > C:\>
> > 
> > Can someone please check the syntax of my curl command?
> > 
> > --  
> > 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/e6fdea56-ca5e-4905-a68b-042472a77fc1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e6fdea56-ca5e-4905-a68b-042472a77fc1%40googlegroups.com).
> 
> > 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/6ce878a8-9ee6-47dd-8f6b-177248da2b31%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6ce878a8-9ee6-47dd-8f6b-177248da2b31%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:** [December 23, 2014, 1:24pm UTC](https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366/4 "2014-12-23T13:24:58Z")

</div>

Use data binary flag

curl -XPUT "[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" --data-binary  
"@put.json"

Jörg

On Tue, Dec 23, 2014 at 12:25 PM, Ashutosh Parab [ashusheva@gmail.com](mailto:ashusheva@gmail.com)  
wrote:

> I have created a put.json file with the following contents:-
> 
> {  
> "type":"jdbc",  
> "jdbc":  
> {"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver",
> 
> "url":"jdbc:sqlserver://LOCALHOST\SQLEXPRESS;databaseName=Report
> 
> \_ME",  
> "user":"user",  
> "password":"password","sql":"select \* from
> 
> [Report.[dbo].[abc]"  
> }
> 
> }
> 
> I try to post config using the command _curl -XPUT  
> "[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)  
> [http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" -d put.json._
> 
> Got the below error:-  
> C:\>curl -XPUT "[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" -d put.json  
> {"error":"MapperParsingException[failed to parse]; nested:  
> ElasticsearchParseExc  
> eption[Failed to derive xcontent from (offset=0, length=8): [112, 117,  
> 116, 46,  
> 106, 115, 111, 110]]; ","status":400}
> 
> Please advice
> 
> On Tuesday, 23 December 2014 16:15:00 UTC+5:30, Jason Zhang wrote:
> 
> > 2 ways to post data using curl:
> > 
> > 1. the data here need to be bracketed like `curl -XPUT '' -d '{ "foo": "bar" }'`
> > 2. put the data into file, then `curl -XPUT '' -d @put.json`.
> > 
> > I think the second is preferred.
> > 
> > On Tue 23.23.14 02:18, Ashutosh Parab wrote:
> > 
> > > I am trying to post jdbc river config using CURL -XPUT on Windows Xp. I  
> > > want to transfer data from MS SQL database into Elastic Search. However  
> > > I  
> > > am getting some exceptions. My Elastic Search version is 1.0.1
> > > 
> > > C:\>curl -XPUT "[http://localhost:9200/\_river/mybooks/\_meta](http://localhost:9200/_river/mybooks/_meta)" -d  
> > > {"type":"jdbc","j  
> > > dbc":{"driver":"com.microsoft.sqlserver.jdbc.  
> > > SQLServerDriver","url":"jdbc:sqlser  
> > > ver://LOCALHOST\SQLEXPRESS;databaseName=Report","user":  
> > > "user","password":"password","sql":"select \* from [Report].[dbo  
> > > ].[abc]","index":"pkId","type":"bigint"}}
> > > 
> > > {"error":"MapperParsingException[failed to parse]; nested:  
> > > JsonParseException[Un  
> > > recognized token 'jdbc': was expecting ('true', 'false' or 'null')\n at  
> > > [Source:  
> > > [B@c7947e; line: 1, column: 12]]; ","status":400}  
> > > C:\>
> > > 
> > > Can someone please check the syntax of my curl command?
> > > 
> > > --  
> > > 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/e6fdea56-ca5e-4905-a68b-042472a77fc1%  
> > > [40googlegroups.com](http://40googlegroups.com).  
> > > 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/6ce878a8-9ee6-47dd-8f6b-177248da2b31%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6ce878a8-9ee6-47dd-8f6b-177248da2b31%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/6ce878a8-9ee6-47dd-8f6b-177248da2b31%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6ce878a8-9ee6-47dd-8f6b-177248da2b31%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/CAKdsXoG2sTq8B404kHiDY%3DmH0z2K1No\_3iZeAgaMKz\_7suasUg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG2sTq8B404kHiDY%3DmH0z2K1No_3iZeAgaMKz_7suasUg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Sanu\_Vimal](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@Sanu\_Vimal](https://discuss.elastic.co/u/Sanu_Vimal)\
**Post date:** [April 6, 2015, 4:19am UTC](https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366/5 "2015-04-06T04:19:31Z")

</div>

Hi Jorg,

Though converting to binary it still dosent parse do you have any  
documentation for jdbc river in windows.The linux one was very helpful but  
not much support for windows.\

Regards,  
Sanu

--  
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/877a6ce9-f0bb-4608-a365-ca71596ab6e7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/877a6ce9-f0bb-4608-a365-ca71596ab6e7%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:** [April 6, 2015, 7:56am UTC](https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366/6 "2015-04-06T07:56:35Z")

</div>

What is your problem with JDBC plugin exactly? Can you post the error  
message?

Jörg

On Mon, Apr 6, 2015 at 6:19 AM, Sanu Vimal [sanuvimal@gmail.com](mailto:sanuvimal@gmail.com) wrote:

> Hi Jorg,
> 
> Though converting to binary it still dosent parse do you have any  
> documentation for jdbc river in windows.The linux one was very helpful but  
> not much support for windows.\
> 
> Regards,  
> Sanu
> 
> --  
> 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/877a6ce9-f0bb-4608-a365-ca71596ab6e7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/877a6ce9-f0bb-4608-a365-ca71596ab6e7%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/877a6ce9-f0bb-4608-a365-ca71596ab6e7%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/877a6ce9-f0bb-4608-a365-ca71596ab6e7%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/CAKdsXoH9v0-58eTEy4-zFBNZbuBE\_n7J988AHbb\_EtWLVEkPTQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoH9v0-58eTEy4-zFBNZbuBE_n7J988AHbb_EtWLVEkPTQ%40mail.gmail.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:21am UTC](https://discuss.elastic.co/t/exception-with-posting-jdbc-river-config/21366/7 "2017-07-06T00:21:33Z")

</div>


