OTS - OTS Manager Error ScriptException: java.lang.RuntimeException
OTS ProcessFlow works in designer but fails when running in Tomcat instance.
Version:
All currently supported versions
Scenario:
ProcessFlow containing a Javascript that uses an SQL connection string runs with no errors in Designer, but fails when running in Tomcat instance. The following error contains the exact java stack trace
Error from Tomcat AllDebug.textreport:
Error encountered in component Script of class com.xenos.d2e.xdc.component.scripting.ScriptComponent, detail:- Error running script: javax.script.ScriptException: java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://appenhancer:58082;instanceName=sqlexpress;databaseName=otg2014;trustServerCertificate=true
<<<RuntimeError>>>
Resolution:
We are getting this error in Open Text's Output Transformation Server version 25.4.0
com.xenos.d2e.exceptions.XenosRuntimeException: Error resolving function/script: java.lang.RuntimeException: javax.script.ScriptException: java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://appenhancer:58082;instanceName=sqlexpress;databaseName=otg2014;trustServerCertificate=true
The following Javascript snippet was placed in the script
Java.type("java.lang.Class").forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); var conn = java.sql.DriverManager.getConnection(url, user, pass);
This is the single most common fix for "no suitable driver" errors thrown specifically from inside script engines — it sidesteps the classloader visibility issue entirely.