I have multiple applications that needs to connect to MSSQL using windows authentication.
The First webApp which is loaded works fine. but the remaining fail prompting
Caused by: java.lang.UnsatisfiedLinkError: Native Library $tomcat/bin/sqljdbc_auth.dll already loaded in another classloader
Below is the code used
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
connection= DriverManager.getConnection("jdbc:sqlserver://localhost;databaseName=XXX;integratedSecurity=true");
I Have placed sqljdbc*.jar --> tomcat*/lib and sqljdbc_auth.dll --> tomcat*/bin
Seems like all my applications are trying to load the shared lib($tomcat/bin/dll) multiple times. Hence the first load works and the remaining fail.
Edit: I understand that the native library (DLL) can only be loaded into the JVM once, hence the error, but I after looking around the net I still have no solution.
How can i load the dll only once?
Please Help!!