A data service using MSSql components configured with Open source JTDS driver, runs as expected in Studio, but when deployed and run from ESB Runtime it throws the following error:
java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver cannot be found by projectName.serviceName_0.1.0
The JTDS driver JAR is not included in the service's published artifact.
By default, the JTDS driver JAR is blacklisted by Studio when building/publishing ESB artifacts. The best practice of database usage in ESB Runtime framework is to use DataSources, so that database management is handled by the Runtime.
However, if you still want this to be managed by the data service Job, then perform the following steps to remove JTDS from the Studio blacklist:
Open the <STUDIO-HOME>\plugins\org.talend.repository_7.3.1.xxxxxxxx_xxxx.jar file.
Extract the osgi-exclude.properties file from the resources folder.
Edit the osgi-exclude.properties file and comment (or remove) the JTDS line:
Save the file in the <STUDIO-HOME>\esb\ folder.
Now the JTDS driver JAR is included in the service's published artifact.