Jdbc-river error: no sqljdbc_auth in java.ibrary.path for sqlserver dll


(Alfredo Serafini) #1

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" -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.
To view this discussion on the web visit 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.


(Jörg Prante) #2

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.
To view this discussion on the web visit 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.


(Alfredo Serafini) #3

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.
To view this discussion on the web visit 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.


(Alfredo Serafini) #4

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.
To view this discussion on the web visit 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.


(Jörg Prante) #5

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 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.
To view this discussion on the web visit 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.


(Alfredo Serafini) #6

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<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.
To view this discussion on the web visit 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.


(Jörg Prante) #7

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGouK4AnOmyfX5Gv4AARUuDwzpfk6x6g2Jb0rF7gPYUGA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #8