Question

I am writing a "server-side extension" for SmartFoxServer (SFS). In my login script, I need to make a connection to MS SQL Server, which I am attempting to do using JDBC. I have tested the JDBC code in my debug environment, and it works fine.

BUT

When I put the server-side extension in the SFS "extensions" folder (as per spec), I'm getting a com.microsoft.sqlserver.jdbc.SQLServerException:

"This driver is not configured for integrated authentication.".

I Googled for this error, and found that it's usually because the file sqljdbc_auth.dll is not in the system path; I have copied this file into a folder in my system path, and still it does not work!

Any other suggestions?

Was it helpful?

Solution

There are different versions of sqljdbc_auth.dll for different processor architectures (x86/x64/ia64). Which one are you using on your SFS server?

You must choose the one to match the architecture of the JVM under which SFS is running. So, if you're running 32-bit Java on a 64-bit machine, you'll need the x86 version, not the x64 version.

I've not used SFS before, so I don't know whether it writes any logs anywhere. If it does, it might be worth taking a look at these logs to see if anything helpful has been written to them.

EDIT: I can't be 100% sure that SFS is using 64-bit Java just because it runs out of C:\Program Files as opposed to C:\Program Files (x86).

I found the following line in the SFS docs under Introduction > Requirements and Installation. Whilst this line applies only to Linux as opposed to Windows, it might suggest that SFS on Windows also uses 32-bit Java:

Since version 1.5 SmartFoxServer comes with its own x86 32-bit Sun Java Runtime.

One quick way to determine which version(s) of Java you have installed is, give the following command in your cmd: Java -version

It will display the following to the console:

C:\Users\967097>java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Here,you can see the bit type of the java version installed.

Does your application work if you use the x86 version of sqljdbc_auth.dll instead of the x64 version? If it suddenly starts working with the x86 DLL, then SFS must be using 32-bit Java.

Is there a batch-file used to start SFS? If so, reading through that might help point out where SFS is running Java from. Also look out for any changes to the PATH. Java can only load DLLs in the java.library.path system property, and on Windows, this is set to the value of the PATH environment variable.

If you still can't determine whether SFS is using 32-bit or 64-bit Java, try using Process Explorer to look at the environment that the java.exe process running SFS was started with.

OTHER TIPS

When using Windows Authentication Integrated Security

  1. Download the sqljdbc_6.0.8112.100_enu.exe from Microsoft Site
  2. Install the exe (read the instructions in the zip path)
  3. copy sqljdbc_4.0/enu/auth/x64/sqljdbc_auth.dll to

    Java/jre7/bin and to

    Java/jre7/lib

After this youj should be able to connect to hibernate tools to pull the database in Data Tools

                                                            Place .dll File In Your JRE Folder:-
I was also facing the same problem and after that I placed sqljdbc_auth.dll (x86 or x64) depending upon your operating system in JRE folder i.e jre7/bin/file.dll and then run my application.jar & it worked perfectly. This worked for me you can also try this may this also help's to you :)

Download the jdbc driver (ver 7.2) from Microsoft and copy the sqljdbc_auth.dll to C:\Program Files\Java\jre\bin and C:\Program Files\Java\jdk\bin folder. You would go to Program Files (x86) folder if you're running Java 32-bit.

In my case, I did the following to resolve:

Downloaded the Microsoft JDBC Driver 8.2 for SQL Server (zip) (found here - https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15).

Then in the zip file, I went into the following folders:

sqljdbc_8.2 > enu > auth > x64

and the copied "mssql-jdbc_auth-8.2.2.x64.dll" to C:\Program Files\Java\jdk-12.0.1\bin

i had faced same issue for the following windows authentication string

jdbc:sqlserver://host:1433;integratedSecurity=true

the default authenticationScheme=NativeAuthentication, So it might depends on some microsoft dlls. To fix it, the update authenticationScheme as NTLM as below

jdbc:sqlserver://host:1433;authenticationScheme=NTLM;integratedSecurity=true;domain=myDomain

note: username given was without domain

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top