I have two web-applications which need to run on Tomcat 6, MS SQL 2008 and JTDS-1.2.2 as driver.
我有两个web应用程序需要运行在Tomcat 6上,MS SQL 2008和JTDS-1.2.2作为驱动程序。
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):
如果我只启动一个web应用程序,一切都很正常,但是当我启动第二个web应用程序时,我就会得到以下错误(它与顺序无关):
java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library
Of course, the library ntlmauth.dll
is under C:\WINDOWS\system32
当然,是图书馆ntlmauth。dll是C:\WINDOWS\system32
It seems that the second application which starts is not able to find the ntlmauth.dll
for the single sign on.
第二个应用程序似乎无法找到ntlmauth。用于单个登录的dll。
4 个解决方案
#1
17
I got past this by changing the url from
我通过改变url来通过这个。
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."
显然,“当URL [does]不包含用户和密码属性时,系统使用Windows身份验证方法,而SSPI本地库没有发现错误。”
#2
17
This is the solution:
这是解决方案:
Download the jTDS driver, unzip it, and copy x86\SSO\ntlmauth.dll
to jdk\jre\bin
.
下载jTDS驱动程序,解压它,并复制x86\SSO\ntlmauth。dll 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
没有JDK的安装,我的路径是c:javajre7bin\ 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.
jTDS必须能够加载本机SPPI库(ntlmauth.dll)。把这个DLL放在系统路径的任何地方(由path系统变量定义),然后就可以设置了。
#3
2
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.
如果您试图在同一个服务器上运行两个(或多个)Tomcat应用程序,它们都使用JTDS驱动程序和windows身份验证访问一个SQL服务器,这是Chris White提供的非常有用的回答。
Chris' answer has to do with sqljdbc_auth.dll, but the recommendations are the same for the JTDS driver and ntlmauth.dll:
Chris的答案与sqljdbc_auth有关。dll,但是对于JTDS驱动程序和ntlmauth.dll的建议是相同的。
- 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 Javajre\bin
directory. - 把ntlmauth。dll到tomcat 7.0\bin目录。事实上,我相信你可以用ntlmauth。dll进入系统路径中的任何目录,或Java jre\bin目录。
- 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. - 重要的是,不要使用JTDS驱动程序将JTDS jar打包到任何Tomcat应用程序的war文件中。相反,将一个副本放到Tomcat\lib目录中,在那里Tomcat将加载它,并使所有应用程序都可以使用它。
#4
2
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.
如果您在64位的windows上,但是运行32位的java(程序文件x86中的一个),那么您需要的是32位的ntlmauth dll,而不是您可能期望的64位。
#1
17
I got past this by changing the url from
我通过改变url来通过这个。
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."
显然,“当URL [does]不包含用户和密码属性时,系统使用Windows身份验证方法,而SSPI本地库没有发现错误。”
#2
17
This is the solution:
这是解决方案:
Download the jTDS driver, unzip it, and copy x86\SSO\ntlmauth.dll
to jdk\jre\bin
.
下载jTDS驱动程序,解压它,并复制x86\SSO\ntlmauth。dll 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
没有JDK的安装,我的路径是c:javajre7bin\ 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.
jTDS必须能够加载本机SPPI库(ntlmauth.dll)。把这个DLL放在系统路径的任何地方(由path系统变量定义),然后就可以设置了。
#3
2
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.
如果您试图在同一个服务器上运行两个(或多个)Tomcat应用程序,它们都使用JTDS驱动程序和windows身份验证访问一个SQL服务器,这是Chris White提供的非常有用的回答。
Chris' answer has to do with sqljdbc_auth.dll, but the recommendations are the same for the JTDS driver and ntlmauth.dll:
Chris的答案与sqljdbc_auth有关。dll,但是对于JTDS驱动程序和ntlmauth.dll的建议是相同的。
- 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 Javajre\bin
directory. - 把ntlmauth。dll到tomcat 7.0\bin目录。事实上,我相信你可以用ntlmauth。dll进入系统路径中的任何目录,或Java jre\bin目录。
- 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. - 重要的是,不要使用JTDS驱动程序将JTDS jar打包到任何Tomcat应用程序的war文件中。相反,将一个副本放到Tomcat\lib目录中,在那里Tomcat将加载它,并使所有应用程序都可以使用它。
#4
2
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.
如果您在64位的windows上,但是运行32位的java(程序文件x86中的一个),那么您需要的是32位的ntlmauth dll,而不是您可能期望的64位。