KB-1291 "Could not find driver for SQL Server... java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver" error thrown when adding a data source in the Admin Console with WebLogic as the application server
Symptoms
When attempting to add a SQL Server data source through the Admin Console, testing the connection fails, and the following error is printed in the application server log:
ERROR com.appiancorp.rdbms.datasource.DataSourceFactory - Could not find driver for SQL Server
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:357)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:318)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:186)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.appiancorp.rdbms.datasource.DataSourceFactory.getDriverClass(DataSourceFactory.java:65)
at com.appiancorp.rdbms.datasource.DataSourceFactory.create(DataSourceFactory.java:50)
at com.appiancorp.rdbms.datasource.TeneoDataSourceValidator.testDataSourceConnection(TeneoDataSourceValidator.java:59)
at com.appiancorp.expression.plugin.DataSourceFunctions.testDataSource_appian_internal(DataSourceFunctions.java:150)
...
Cause
Weblogic cannot locate the appropriate SQL Server JDBC driver needed to connect to the database.
Action
- Download the appropriate SQL Server JDBC driver.
- Place the sqljdbc*.jar file (e.g., sqljdbc4.jar) in the
<WEBLOGIC_HOME>/user_projects/domains/base_domain/libdirectory. - Restart the application server.
- Try adding the data source again.
Affected Versions
This article applies to Appian 16.1 and later using WebLogic as the application server.
Last Reviewed: March 2017
