Tomcat: Error while hosting two webapps => Native Library sqljdbc_auth.dll already loaded in another classloader

813 Views Asked by At

I have read all the similar posts on SO but I still run into the same problem. I have two applications that run off of the same Tomcat instance. If I access either one on the browser it works fine, but as soon as I try to access the second one, I get this error "Native Library C:\Users\luis\workspace\sqljdbc_4.0\enu\auth\x64\sqljdbc_auth.dll already loaded in another classloader"

I have played around with where I place sqljdbc_auth.dll but have had no luck so far. As of right now it is only sitting on sqljdbc4.0/enu/auth, I even deleted it from C:/WINDOWS/System32

Is there a definite where-to in terms of the location where sqljdbc_auth.dll should sit?

1

There are 1 best solutions below

0
On

You must load the SQL Server driver from Tomcat's classloader ($CATALINA_HOME/lib) and not your webapp's classloader. Move the JAR and declare a datasource in your context.xml. That should solve your problem.