I’m running IIQ on Apache Tomcat, and I’m getting the error below when I try to access a Tomcat managed datasource from a Rule running in a Task:
sailpoint.tools.GeneralException: The application script threw an exception: java.sql.SQLException: Cannot load JDBC driver class ‘com.microsoft.sqlserver.jdbc.SQLServerDriver’
The Beanshell code that causes the error is the lookup() on the third line below:
Context initialContext = new InitialContext();
DataSource datasource = (DataSource) initialContext.lookup("java:/comp/env/jdbc/MYDS");
Connection connection = datasource.getConnection();
My Tomcat server.xml contains:
<Resource name="jdbc/DS"
global="jdbc/DS"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://<IPADDR>:1433;DatabaseName=Database;user=user;password=password;encrypt=true;trustServerCertificate=true"
username="user" password="password"
maxTotal="20"
initialSize="0"
minIdle="0"
maxIdle="8"
maxWaitMillis="10000"
timeBetweenEvictionRunsMillis="30000"
minEvictableIdleTimeMillis="60000"
testWhileIdle="true"
poolPreparedStatements="true"
maxOpenPreparedStatements="100"
validationQuery="SELECT 1"
maxAge="600000"
rollbackOnReturn="true"
/>
and my Tomcat context.xml contains:
<ResourceLink name="jdbc/MYDS"
global="jdbc/DS"
auth="Container"
type="javax.sql.DataSource" />
Any help would be appreciated.