Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no sqljdbc_auth in java.library.path

 
kevind duff
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Kind Java Dudes and Dudettes:

I have a a small issue. I guess my first problem is that I am using MS-SQL as my back end, but that was not my call.
We are also using integrated authentication on MS-SQl server.

Please note I have this program working under Eclipse.

I am running a simple batch file to setup the run for this java program.
This the output I get at the command line:

T:\IT\code_base\qa\investor_bridge\IB_Rest\bin>
"\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\Java\jre6\\bin\java"
-Xmx512m -Dlog4j.configuration=log4jproperties -Djava.library.path=\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\ms_sql_jdbc_3.0.1\sqljdbc_3.0\enu\sqljdbc_auth.dll
-classpath "\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\Restlet Framework\Edition Java SE\2.0.8\lib\org.restlet.jar";
"\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\Restlet Framework\Edition Java SE\2.0.8\lib\org.restlet.ext.net.jar";
"\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\apache_commons\commons-codec-1.5-bin\commons-codec-1.5.jar";
"\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\ms_sql_jdbc_3.0.1\sqljdbc_3.0\enu\sqljdbc4.jar";


"\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\apache-log4j-1.2.16\log4j-1.2.16.jar";.
IB_Post_DocB
\\fileprint-01\Data\Company\WRInvest\IT\code_base\qa\investor_bridge\IB_Rest\config_files\IBRest.prop
\\fileprint-01\Data\Company\WRInvest\IT\code_base\qa\xml

0 [main] INFO IB_Post_DocB - Property file: \\fileprint-01\Data\Company\WRInvest\IT\code_base\qa\investor_bridge\IB_Rest\con
fig_files\IBRest.prop has been read


I get the dump below from the code.

So my questions are: Am I setting the java.library.path correctly?
This integrated MS-SQL authentication caused me a problem under Eclipse also , but after I placed sqljdbc_auth.dll
in C:\Windows\System32 the problem went away. So there is another question why is the JVM not finding
sqljdbc_auth.dll in the Windows Path.

Your kind assistance is requested.

Thanks

KD



code_base\qa\xml
0 [main] INFO IB_Post_DocB - Property file: \\fileprint-01\Data\Company\WRInvest\IT\code_base\qa\investor_bridge\IB_Rest\con
fig_files\IBRest.prop has been read
Jul 7, 2011 7:29:26 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
WARNING: Failed to load the sqljdbc_auth.dll cause :- no sqljdbc_auth in java.library.path
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1352)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2329)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1905)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:1893)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1045)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at IB_Post_DocB.getDBConn(IB_Post_DocB.java:570)
at IB_Post_DocB.main(IB_Post_DocB.java:148)
Caused by: java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<clinit>(AuthenticationJNI.java:32)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1902)
... 12 more
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe, putting the DLL reference in Classpath and Path, should solve your problem.
 
kevind duff
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Madhan:

Thanks for your quick reply.

I am checking the details as carefully as I can.

C:\Windows\system32 is in the path and sqljdbc_auth.dll is in C:\Windows\system32. See below.
And the error specifically says no sqljdbc_auth in java.library.path

Please also note when I run this code in Eclipse sqljdbc_auth.dll is not in the classpath.

I am confused. javascript:emoticon('');

KD

C:\>dir C:\Windows\system32\sqljdbc*.dll
Volume in drive C is OS
Volume Serial Number is 9A4D-215A

Directory of C:\Windows\system32

04/19/2010 10:08 AM 86,408 sqljdbc_auth.dll
1 File(s) 86,408 bytes
0 Dir(s) 196,831,354,880 bytes free

C:\>


 
Fail Everyday
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

i had the same issue while using the Microsoft SQL Server JDBC Driver 3.0
Failed to load the sqljdbc_auth.dll cause :- no sqljdbc_auth in java.library.path

I am using a custom ant target connecting to a MS SQL DB during execution. I have putted the jar "sqljdbc4.jar" into my class path and got the above exception.
solution for me was adding the mentioned dll to the windows Path variable ( yes ugly but adding it to the classpath in my ant target didn't work)

note:
if your are using the Microsoft SQL Server JDBC Driver 3.0, there is a auth dll for each plattform in your "installation" folder of Microsoft SQL Server JDBC Driver 3.0 -> \sqljdbc_3.0\enu\auth\, in my case x86 ....
 
kevind duff
Greenhorn
Posts: 23
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All:

I found the solution. The location of sqljdbc_auth.dll must be specified using -Djava.library.path=[path to MS_SQL_AUTH_DLL]

Where [path to MS_SQL_AUTH_DLL] is path to the directory containing the sqljdbc_auth.dll.
Please note another got'ya the sqljdbc_auth.dll must match the JVM you are running.
If you are using 32 bit JVM use the 32 bit DLL, for 64 bit JVM use the 64 bit DLL.

This may help
http://social.msdn.microsoft.com/forums/en-US/sqldataaccess/thread/1c1a1313-057d-46d4-9ca7-82fc4f23a150/


KD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic