Search code examples
javajdbctomcat7activiticatalina

JDBC with MSSQL on tomcat7 catalina


I am trying to configure activiti to communicate ms-sql 2014 with windows authentication instead of with username/password in connection url.
What i have done ?

  1. downloaded JDBC Driver, put sqljdbc4-3-0.jar in JAVA_HOME and in the web-info\lib
  2. put sqljdbc_auth.dll (64bit) in C:\Windows\System32
  3. set integrated security in db.properties as following:

db.properties (C:\Workflow\apache-tomcat-7.0.62\webapps\activiti-explorer\WEB-INF\classes):

db=mssql
jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://127.0.0.1:1433;databaseName=activiti;integratedSecurity=true;

When using regular authentication (I remove the integratedSecurity=true and add user=XXX and password=XXX it works!)

When I open log the last line is:

DEBUG org.springframework.jdbc.datasource.SimpleDriverDataSource: Creating new JDBC Driver Connection to [jdbc:sqlserver://localhost;databaseName=activiti;integratedSecurity=true;]

Then the java application shutsdown and i see hs_err_pid4232.log as attached with exception:

 EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000061a3cf13, pid=4232, tid=8080

What can cause this not to work ?
I want thinking maybe it did not load the DLL/JARS it should be in order to use JDBC driver ? the sql server config looks like this:
enter image description here

The log of process crush is at: http://pastebin.com/xpW5yvEP


Solution

  • This error screams "trouble with the authentication dll". Try these steps:

    • Download latest sqljdbc, unzip it locally from here: https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774

    • put the .jar in your classpath and the .dll in your library path. Try using a "real" path by adding -Djava.library.path=PATH/TO/DLL into your startup.

    • run java -fullversion to make sure you have the right .dll (32 bit vs 64 bit) installed there.

    • run program again.