简体   繁体   中英

java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library

I have two web-applications which need to run on Tomcat 6, MS SQL 2008 and JTDS-1.2.2 as driver.

If I start only one web application everything is working fine, but as soon as I start the second one I get the following error (it does not matter the order):

java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library

Of course, the library ntlmauth.dll is under C:\\WINDOWS\\system32

It seems that the second application which starts is not able to find the ntlmauth.dll for the single sign on.

I got past this by changing the url from

jdbc:jtds:sqlserver://host_server:1433/Database_name

to

jdbc:jtds:sqlserver://host_server:1433/Database_name;user=XXX;password=YYY

Apparently, "When URL [does] not contains user and password properties, systems uses Windows authentication method, and "SSPI Native library not found" error appears."

This is the solution:

Download the jTDS driver , unzip it, and copy x86\\SSO\\ntlmauth.dll to jdk\\jre\\bin .

This should solve your issue.

Edit:

Without the JDK installed the path for me was C:\\Program Files\\Java\\jre7\\bin\\ntlmauth.dll

jTDS must be able to load the native SPPI library (ntlmauth.dll). Place this DLL anywhere in the system path (defined by the PATH system variable) and you're all set.

If you are trying to run two (or more) Tomcat applications on the same server that both access a SQL Server using the JTDS driver and windows authentication, a very helpful answer courtesy of Chris White is here .

Chris' answer has to do with sqljdbc_auth.dll, but the recommendations are the same for the JTDS driver and ntlmauth.dll:

  1. Put ntlmauth.dll into the tomcat 7.0\\bin directory. Actually, I believe you can put ntlmauth.dll into any directory in the system path, or the Java jre\\bin directory.
  2. Importantly, don't bundle the JTDS jar in the war file of any Tomcat application using the JTDS driver. Instead, put one copy in the Tomcat\\lib directory, where Tomcat will load it and make it available to all apps.

如果你在64位窗口但运行32位java(程序文件x86中的那个),那么你需要32位ntlmauth dll而不是你可能期望的64位。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM