# Jdbc-river error: no sqljdbc\_auth in java.ibrary.path for sqlserver dll

**URL:** <https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320>\
**Category:** Elasticsearch\
**Created:** [January 20, 2014, 11:42am UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320 "2014-01-20T11:42:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![seralf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seralf/32/44805_2.png) [@seralf](https://discuss.elastic.co/u/seralf)\
**Post date:** [January 20, 2014, 11:42am UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320/1 "2014-01-20T11:42:02Z")

</div>

Hi to all

I have the following problem with sqlserver authentication.

I am using Elasticsearch with SQLServer using the mixed authentication; I  
define my indexing on the river plugin as something like:

> > curl -XPUT "[http://localhost:9200/\_river/itra\_jdbc\_river/\_meta](http://localhost:9200/_river/itra_jdbc_river/_meta)" -d'  
> > {  
> > "type": "jdbc",  
> > "jdbc": {  
> > "driver": "com.microsoft.sqlserver.jdbc.SQLServerDriver",  
> > "url":  
> > "jdbc:sqlserver://MY\_SERVER;integratedSecurity=true;databaseName=MY\_DB",  
> > "user": "INTRANET\MY\_USER",  
> > "password": "MY\_PWD",  
> > "sql": "SELECT \* FROM A\_TABLE",  
> > "versioning": false  
> > },  
> > "index": {  
> > "index": "test",  
> > "type": "values"  
> > }  
> > }'

and I started ES with -Djava.library.path="mssql\auth\x64" option, where  
"mssql" folder is under the jdbc-river plugin folder.

However, I still obtain the "no sqljdbc\_auth in java.ibrary.path" error, so  
the dll seems to be not correctly referenced. I also notice that the jar  
for sqlserver must be instead on the jdbc-river folder itself.

Any suggestions?

thanks in advance,  
Alfredo

--  
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/000230a4-2f06-4fc8-b1f1-56ec69ada894%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/000230a4-2f06-4fc8-b1f1-56ec69ada894%40googlegroups.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:** [January 20, 2014, 12:41pm UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320/2 "2014-01-20T12:41:06Z")

</div>

Please, use absolute paths in java.library.path

Of course, JDBC jars must be in the jdbc-river folder, otherwise they can  
not be found by ES plugin manager.

Jörg

--  
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/CAKdsXoHZzUHH7wwhBAfnv700UCZW85z\_f\_qf\_H-9VKWcXV3oUw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHZzUHH7wwhBAfnv700UCZW85z_f_qf_H-9VKWcXV3oUw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![seralf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seralf/32/44805_2.png) [@seralf](https://discuss.elastic.co/u/seralf)\
**Post date:** [January 20, 2014, 1:02pm UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320/3 "2014-01-20T13:02:36Z")

</div>

> Please, use absolute paths in java.library.path

With other java applications a relative path works without too much  
problems, so this was my first test. I've tested it also with absolute  
path, without luck. I've also tried with '\' instead of '', or with '/',  
just to avoid problems with windows paths.

Any other suggestion?

> Of course, JDBC jars must be in the jdbc-river folder, otherwise they can  
> not be found by ES plugin manager.

done, in fact removing the jar, the error changes to "no suitable  
driver..." etc etc

thanks,  
Alfredo

--  
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/2884abe0-93d9-4164-8588-7dc0ee1da4b3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2884abe0-93d9-4164-8588-7dc0ee1da4b3%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![seralf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seralf/32/44805_2.png) [@seralf](https://discuss.elastic.co/u/seralf)\
**Post date:** [January 20, 2014, 1:42pm UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320/4 "2014-01-20T13:42:46Z")

</div>

Hi

a little update: adding the reference to the absolute path in the Path  
variable worked... thus seems like ES is currently ignoring the  
-Djava.library.path parameter passed from command line. Is that possible?

Il giorno lunedì 20 gennaio 2014 14:02:36 UTC+1, Alfredo Serafini ha  
scritto:

> Please, use absolute paths in java.library.path
> 
> > 
> 
> With other java applications a relative path works without too much  
> problems, so this was my first test. I've tested it also with absolute  
> path, without luck. I've also tried with '\' instead of '', or with '/',  
> just to avoid problems with windows paths.
> 
> Any other suggestion?
> 
> > Of course, JDBC jars must be in the jdbc-river folder, otherwise they can  
> > not be found by ES plugin manager.
> 
> done, in fact removing the jar, the error changes to "no suitable  
> driver..." etc etc
> 
> thanks,  
> Alfredo

--  
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/bf6443af-25c9-4839-85e4-3f00f3cb4dc8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf6443af-25c9-4839-85e4-3f00f3cb4dc8%40googlegroups.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:** [January 20, 2014, 1:54pm UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320/5 "2014-01-20T13:54:57Z")

</div>

You have to add parameters for the Java JVM in the JAVA\_OPTS variable, e.g.  
in $ES\_HOME/bin/elasticsearch.in.sh

For Windows I don't know where to set JAVA\_OPTS but maybe there is  
something like $ES\_HOME/bin/elasticsearch.bat

Jörg

On Mon, Jan 20, 2014 at 2:42 PM, Alfredo Serafini [seralf@gmail.com](mailto:seralf@gmail.com) wrote:

> Hi
> 
> a little update: adding the reference to the absolute path in the Path  
> variable worked... thus seems like ES is currently ignoring the  
> -Djava.library.path parameter passed from command line. Is that possible?

--  
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/CAKdsXoEuYUR1OUZUmX0A0-vQ0aRGTF%2BD3Tqo5eX7aMD-eHnUtA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEuYUR1OUZUmX0A0-vQ0aRGTF%2BD3Tqo5eX7aMD-eHnUtA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![seralf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seralf/32/44805_2.png) [@seralf](https://discuss.elastic.co/u/seralf)\
**Post date:** [January 20, 2014, 2:43pm UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320/6 "2014-01-20T14:43:18Z")

</div>

Hi Jorg thanks,  
I have used indeed the JAVA\_OPTS variable in elasticsearch.bat, but for  
some reason it is not working as expected: i have tested it with/without  
double quotes, linux-like paths or win paths, absolut vs relative etc  
etc... at the moment the only thing that is working is using the Path  
environment variable. Please note that for example i'm using D2RQ java tool  
with -Djava.library.path=a-relative-path and it's working. I have also  
tried using a copy of the same dll without point to the same, but nothing.  
Do you have nay other ideas?

thanks for your support,  
Alfredo

Il giorno lunedì 20 gennaio 2014 14:54:57 UTC+1, Jörg Prante ha scritto:

> You have to add parameters for the Java JVM in the JAVA\_OPTS variable,  
> e.g. in $ES\_HOME/bin/elasticsearch.in.sh
> 
> For Windows I don't know where to set JAVA\_OPTS but maybe there is  
> something like $ES\_HOME/bin/elasticsearch.bat
> 
> Jörg
> 
> On Mon, Jan 20, 2014 at 2:42 PM, Alfredo Serafini \<[ser...@gmail.com](mailto:ser...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi
> > 
> > a little update: adding the reference to the absolute path in the Path  
> > variable worked... thus seems like ES is currently ignoring the  
> > -Djava.library.path parameter passed from command line. Is that possible?

--  
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/4c42052e-0445-497a-998f-8039fd2a92a5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4c42052e-0445-497a-998f-8039fd2a92a5%40googlegroups.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:** [January 20, 2014, 2:56pm UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320/7 "2014-01-20T14:56:04Z")

</div>

Would love to help, also to Windows elasticsearch.bat specific problems,  
but I'm afraid I can't.

Fact is, you have to find out where the Java Runtime of Elasticsearch is  
executed - it is in the script elasticsearch or in case of Windows  
elasticsearch.bat - and in that call, you must add JVM arguments like  
java.library.path, and because the library loading is executed from a  
daemon process, you have to choose absolute paths, so it can not fail. ES  
provides JAVA\_OPTS variable for convenience to collect several JVM  
arguments defined in scripts.

Example

-Djava.library.path=C:\Users\Dummy\Downloads\sqljdbc\_4.0\enu\auth\x64

Jörg

--  
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/CAKdsXoGouK4AnOmyfX5Gv4AARUuDwzpfk6x6g2Jb0rF7gPYUGA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGouK4AnOmyfX5Gv4AARUuDwzpfk6x6g2Jb0rF7gPYUGA%40mail.gmail.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, 1:55am UTC](https://discuss.elastic.co/t/jdbc-river-error-no-sqljdbc-auth-in-java-ibrary-path-for-sqlserver-dll/15320/8 "2017-07-06T01:55:51Z")

</div>


