Lavalyte
9 years agoOccasional Contributor
can't register JDCB driver class
When using SoapUI Opensource;
I have a mock server groovy script that is attempting to access a sql server database.
My soapUI installation has a valid sqljdbc4.jar file in /ext directory.
My groovy script contains
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
When I run a request that calls the mocked service I get this error:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Failed to dispatch using script; java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
- Hope you might copied the library under SOAPUI_HOME/bin/ext and restarted soapui.
- It requires to register the driver using below statement in the groovy script as per the documentation
- Of course, you need to change the driver class in below statement as well.
com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( "com.mysql.jdbc.Driver" )