I’m rather new to Hibernate and currently exploring all the functionalities but I do have one issue where I’m stuck and I hope someone can point me in the right direction. Hibernate tools are always throwing an error when I try to connect to my MS SQL Server DB using integrated Security (Windows Authentication) in the “Hibernate Configurations”-View in Eclipse.
The error indicates that the “sqljdbc_auth.dll” file is already loaded in another classloader. I can’t figure out why and where this happens and ultimately how to solve this.
I’m running the following setup:
Eclipse Photon 4.8.0
Hibernate Tools 5.4.7
JDK 1.8 x64
MS SQL JDBC 6.0 Driver (tried different versions as well, including the latest one)
As a side note: Connecting to the DB from the Java Code itself (using Hibernate) is working properly. It’s only the Hibernate Tools which I can’t get working.
The full stack trace of the error-message:
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
Error calling Driver#connect
org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
Error calling Driver#connect
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:dd9decbd-2588-47e9-ae06-caadcb27472e
This driver is not configured for integrated authentication. ClientConnectionId:dd9decbd-2588-47e9-ae06-caadcb27472e
java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\Java\jre1.8.0_231\bin\sqljdbc_auth.dll already loaded in another classloader
Native Library C:\Program Files\Java\jre1.8.0_231\bin\sqljdbc_auth.dll already loaded in another classloader
Would be glad if someone has any Idea how this can be solved.
Many thanks
Jan
Can you please describe what tools (JBoss Tools version?) you are using and what manipulation you are executing when this happens? Is there a sample project we can use to try and replicate this?
thanks for your fast response.
I’ve installed the Jboss Tools just two days ago from the Eclipse Marketplace, therefore assuming it’s the latest available version (attached a screenshot for your reference).
Placed the “sqljdbc_auth.dll” (x64) from the MS SQL JDBC driver into Java/JDK(JRE)/bin folder (also tried different locations or adding its path to java.library.path or as native library into the project itself) in order to be able to use Windows authentication for the DB connection.
Switched to the Eclipse-View “Hibernate Configurations” and created a new configuration for my sample project using the existing hibernate.cfg.xml.
When trying to expand this configuration (by selecting “Rebuild” or “Refresh”) the error message is thrown. (Tried to illustrate the steps with additional screenshots but it looks like I can only attach one to my post)
Maybe I did something completely wrong here…just worked through different tutorials to get started.