# Error occurred before establishing the connection with Server - ClassNotFoundException

**URL:** <https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122>\
**Category:** SHF Discussion and Questions\
**Tags:** sources, identity-security-cloud, aggregation\
**Created:** [April 11, 2023, 4:32am UTC](https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122 "2023-04-11T04:32:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ncrai20](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@ncrai20](https://developer.sailpoint.com/discuss/u/ncrai20)\
**Post date:** [April 11, 2023, 4:32am UTC](https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122/1 "2023-04-11T04:32:28Z")

</div>

Hi All,

I getting following error while connecting to Microsoft SQL Server.

Error Received:  
[InvalidConfigurationException] [Possible suggestions] Verify that the driver details are correct/Missing required jar. [Error details] Error occurred before establishing the connection with Server. java.lang.ClassNotFoundException : com.microsoft.sqlserver.jdbc.SQLServerDriver

Following are my sanitized connection settings:

User Name: svcaccount  
Password: \*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Uploaded Files: sqljdbc42-6.0.8112.jar

Database URL: jdbc:sqlserver://db server fqdn:1433;DatabaseName=dbname  
Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver  
Test Connection SQL Query: Select 1  
Use Stored Procedure for Test Connection SQL Query: false  
Account SQL Query: Select 1  
Use Stored Procedure for Account SQL Query: false

Has any faced this issue? Any help or insights would be great.

I appreciate your help.

Thanks.

---

<div class="post-metadata">

**Author:** ![ncrai20](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@ncrai20](https://developer.sailpoint.com/discuss/u/ncrai20)\
**Post date:** [April 11, 2023, 4:34am UTC](https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122/2 "2023-04-11T04:34:21Z")

</div>

Also, connector from the VA to the DB server and port is good. I’ve tested that.

---

<div class="post-metadata">

**Author:** ![ethompson](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ethompson/32/17298_2.png) [@ethompson](https://developer.sailpoint.com/discuss/u/ethompson)\
**Post date:** [April 11, 2023, 1:58pm UTC](https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122/3 "2023-04-11T13:58:52Z")

</div>

Here is an example of a working MS SQL Source config that is using SSL (might not be needed) and a different jar.

**DB URL:**  
jdbc:sqlserver://`<server>`:1433;DatabaseName=`<dbname>`;encrypt=true;trustServerCertificate=true;

**Jar File:**  
[https://community.sailpoint.com/t5/IdentityNow-Connectors/How-do-I-obtain-the-JAR-file-needed-for-the-Microsoft-SQL-Server/ta-p/80757](https://community.sailpoint.com/t5/IdentityNow-Connectors/How-do-I-obtain-the-JAR-file-needed-for-the-Microsoft-SQL-Server/ta-p/80757)

> **[Download - JDBC Driver for SQL Server](https://learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15)**
>
> Download the Microsoft JDBC Driver for SQL Server to develop Java applications that connect to SQL Server and Azure SQL Database.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/8/8af9b0df696fee2698cad2aa49ad373324535ec3.png)

---

<div class="post-metadata">

**Author:** ![SailAway](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@SailAway](https://developer.sailpoint.com/discuss/u/SailAway)\
**Post date:** [May 9, 2023, 8:09pm UTC](https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122/4 "2023-05-09T20:09:16Z")

</div>

I keep getting the same error. Any fixes? Weird cause some times it will connect and pull accounts but most of the time it gives the error. The driver is present. Has been working before but now almost never able to pull account.

[InvalidConfigurationException] [Possible suggestions] Verify that the driver details are correct/Missing required jar. [Error details] Error occurred before establishing the connection with Server. java.lang.ClassNotFoundException : com.microsoft.sqlserver.jdbc.SQLServerDriver

---

<div class="post-metadata">

**Author:** ![Bakhari](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/bakhari/32/29973_2.png) [@Bakhari](https://developer.sailpoint.com/discuss/u/Bakhari)\
**Post date:** [June 15, 2023, 3:15pm UTC](https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122/5 "2023-06-15T15:15:35Z")

</div>

Not sure if you got this fixed or not, but for me, the issue was two fold.  
1.We were using the wrong jar file (make sure you go to the website @ethompson mentioned to find the correct one and that you select the jre8 version) and  
2.traffic from our VA was not being allowed through the firewall on port 1433 to the database server. Once we resolved those two issues, everything started working again. 🙂

---

<div class="post-metadata">

**Author:** ![Remold](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/remold/32/3275_2.png) [@Remold](https://developer.sailpoint.com/discuss/u/Remold)\
**Post date:** [June 15, 2023, 9:52pm UTC](https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122/6 "2023-06-15T21:52:21Z")

</div>

Please also verify the jar files is only located in either WEB-INF/lib or WEB-INF/lib-connectors. When it is located in both you might end up with this and other issues.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [August 14, 2023, 9:53pm UTC](https://developer.sailpoint.com/discuss/t/error-occurred-before-establishing-the-connection-with-server-classnotfoundexception/10122/7 "2023-08-14T21:53:08Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
