java.sql.SQLException:I/O 错误:SSO 失败:本机 SSPI 库
我有两个网络应用程序需要在 Tomcat 6、MS SQL 2008 和 JTDS-1.2.2 作为驱动程序上运行。
如果我只启动一个 Web 应用程序,一切工作正常,但一旦启动第二个应用程序,我就会收到以下错误(顺序无关):
java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library
当然,库 ntlmauth.dll
位于C:\WINDOWS\system32
下,
似乎第二个启动的应用程序无法找到用于单点登录的ntlmauth.dll
。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我通过将 url 从 更改为
显然
,“当 URL [不] 不包含用户和密码属性时,系统使用 Windows 身份验证方法,并且出现“未找到 SSPI 本机库”错误。”
I got past this by changing the url from
to
Apparently, "When URL [does] not contains user and password properties, systems uses Windows authentication method, and "SSPI Native library not found" error appears."
这是解决方案:
下载jTDS 驱动程序,解压它,并将 x86\SSO\ntlmauth.dll 复制到 jdk\jre\bin 中。
这应该可以解决你的问题。
编辑:
如果没有安装 JDK,我的路径是
C:\Program Files\Java\jre7\bin\ntlmauth.dll
jTDS 必须能够加载本机 SPPI 库 (ntlmauth.dll)。将此 DLL 放置在系统路径(由 PATH 系统变量定义)中的任何位置,然后一切就完成了。
This is the solution:
Download the jTDS driver, unzip it, and copy
x86\SSO\ntlmauth.dll
tojdk\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.
如果您尝试在同一台服务器上运行两个(或更多)Tomcat 应用程序,并且它们都使用 JTDS 驱动程序和 Windows 身份验证访问 SQL Server,Chris White 提供的一个非常有用的答案是 此处。
Chris 的回答与 sqljdbc_auth.dll 有关,但对于 JTDS 驱动程序和 ntlmauth.dll 的建议是相同的:
tomcat 7.0\bin
目录中。实际上,我相信您可以将ntlmauth.dll放入系统路径中的任何目录中,或者Javajre\bin
目录中。Tomcat\lib
目录中,Tomcat 将在其中加载它并使其可供所有应用程序使用。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:
tomcat 7.0\bin
directory. Actually, I believe you can put ntlmauth.dll into any directory in the system path, or the Javajre\bin
directory.Tomcat\lib
directory, where Tomcat will load it and make it available to all apps.如果您使用的是 64 位 Windows,但运行 32 位 java(程序文件 x86 中的 java),那么您需要 32 位 ntlmauth dll,而不是您可能期望的 64 位 dll。
If you are on 64-bit windows but running 32-bit java (the one in program files x86) then you need the 32-bit ntlmauth dll and not the 64 bit one that you might have expected.