Forum Discussion

Rasilio's avatar
Rasilio
New Contributor
13 years ago

JDBC drivers not loading

I'm trying to create a JDBC connection test step and things are not going so well.

The database is Postgres 9.1 and I am running SoapUI 4.5.1 Pro

When I configure the connection I get the following error message...

Wed Apr 03 15:12:02 EDT 2013:ERROR:An error occured [No suitable driver], see error log for details



After googling around I've validated that the drivers are in the /bin/ext directory, however it appears that they are not being added to the classpath when SoapUI loads as I do not see any message in the SoapUI log indicating that they are. Here is the log immediately following launch...

Wed Apr 03 15:02:31 EDT 2013:INFO:initialized soapui-settings from [C:\Users\scollins\soapui-settings.xml]
Wed Apr 03 15:02:31 EDT 2013:INFO:Setting Script Library to [C:\Program Files\SmartBear\soapUI-Pro-4.5.1\bin\scripts]
Wed Apr 03 15:02:31 EDT 2013:INFO:Adding listeners from [C:\Program Files\SmartBear\soapUI-Pro-4.5.1\bin\listeners\demo-listeners.xml]
Wed Apr 03 15:02:32 EDT 2013:INFO:Loading workspace from [C:\Users\scollins\default-soapui-workspace.xml]
Wed Apr 03 15:02:32 EDT 2013:INFO:Loaded project from [file:/C:/Users/scollins/Documents/Market-Maker-Sim-soapui-project.xml]
Wed Apr 03 15:02:32 EDT 2013:INFO:Setting Script Library to [C:\Program Files\SmartBear\soapUI-Pro-4.5.1\bin\scripts]
Wed Apr 03 15:02:33 EDT 2013:INFO:Loaded project from [file:/C:/Users/scollins/soapUI-Tutorials/sample-soapui-project.xml]
Wed Apr 03 15:02:33 EDT 2013:INFO:Loaded project from [file:/C:/Users/scollins/Documents/QARegistration-soapui-project.xml]
Wed Apr 03 15:02:33 EDT 2013:INFO:Setting Script Library to [C:\Program Files\SmartBear\soapUI-Pro-4.5.1\bin\scripts]
Wed Apr 03 15:02:33 EDT 2013:INFO:Loaded project from [file:/C:/Users/scollins/Documents/ExchLogin-soapui-project.xml]
Wed Apr 03 15:02:33 EDT 2013:INFO:Setting Script Library to [C:\Program Files\SmartBear\soapUI-Pro-4.5.1\bin\scripts]
Wed Apr 03 15:02:33 EDT 2013:INFO:Used java version: 1.7.0_02
Scheduling garbage collection every 60 seconds
Wed Apr 03 15:02:34 EDT 2013:INFO:Adding actions from [C:\Program Files\SmartBear\soapUI-Pro-4.5.1\bin\actions\demo-actions.xml]
The cajo server is running on localhost:1198/soapuiIntegration



Does anyone have any clue what I need to do to get the drivers to load to the classpath?

1 Reply

  • When looking at the testrunner.bat script that comes with SoapUI, in regards to this question, I notice a few things:

    1. The %SOAPUI_HOME%\ext path is being added as a "-Dsoapui.ext.libraries" JAVA_OPTS var to the JVM, rather than being added on the classpath. I suspect this is the case because some special class loading probably has to occur for the JDBC libraries. So, you are right, the "ext" dir is not being added to the classpath. I think most 3rd party libraries could be added to the standard CLASSPATH but the testrunner.bat script doesn't support that (see #3 below).

    2. The CLASSPATH var that is defined in the testrunner.bat is NOT being passed to the JVM with the "-cp" option when the SoapUITestCaseRunner is being invoked. This is unusual, but I suspect that the runner is retrieving the CLASSPATH var from within the code itself instead.

    3. It is really unfortunate that the CLASSPATH var in the testrunner.bat is not defined like this instead, because it would allow custom location of .jar files within projects which don't exist anywhere under the SOAPUI_HOME location.

    IF NOT DEFINED CLASSPATH SET CLASSPATH=.
    IF DEFINED PRE_CLASSPATH set CLASSPATH=%PRE_CLASSPATH%;%CLASSPATH%
    SET CLASSPATH=%CLASSPATH%;%SOAPUI_HOME%soapui-4.5.1.jar;%SOAPUI_HOME%..\lib\*


    That would allow definining a PRE_CLASSPATH in another script so, in theory, you would be able to add custom .jars used by Groovy scripts (although I would imagine JDBC .jars still need to be under ext ?)