Forum Discussion

Yurie's avatar
New Contributor
2 years ago

JDBC connections in docker containers

I am using the smartbear/soapuios-testrunner container image.
I am trying to make a JDBC connection to postgres, but I get an error.
What I have done is

1. put postgresql-42.5.0.jar in the ext folder
2. start the docker container


docker run --add-host localhost: --rm \
-v="<projectFolder>":/project \
-v="<reportFolder>":/reports \
-v="<extFolder>/ext":/ext \
-e COMMAND_LINE="/%project%/soapuiProject.xml -r -M -f /%reports% \
-it smartbear/soapuios-testrunner:latest

Groovy Script:

import groovy.sql.Sql

def driver = 'org.postgresql.Driver';

Map batchDBConnParams = [
driver: 'org.postgresql.Driver'
def conn = Sql.newInstance(batchDBConnParams);


ERROR [SoapUI] An error occurred [org.postgresql.Driver], see error log for details
05:32:26,270 ERROR [errorlog] java.lang.ClassNotFoundException: org.postgresql.Driver
java.lang.ClassNotFoundException: org.postgresql.Driver
	at jdk.internal.loader.BuiltinClassLoader.loadClass( ~[?:?]
	at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass( ~[?:?]
	at java.lang.ClassLoader.loadClass( ~[?:?]
	at java.lang.Class.forName0(Native Method) ~[?:?]
	at java.lang.Class.forName( ~[?:?]
	at groovy.sql.Sql.loadDriver( ~[groovy-sql-3.0.6.jar:3.0.6]
	at groovy.sql.Sql.newInstance( ~[groovy-sql-3.0.6.jar:3.0.6]
	at groovy.sql.Sql$ Source) ~[?:?]
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall( ~[groovy-3.0.6.jar:3.0.6]
	at ~[groovy-3.0.6.jar:3.0.6]
	at ~[groovy-3.0.6.jar:3.0.6]
	at ~[?:?]
	at ~[soapui-5.7.0.jar:5.7.0]
	at [soapui-5.7.0.jar:5.7.0]
	at [soapui-5.7.0.jar:5.7.0]
	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep( [soapui-5.7.0.jar:5.7.0]
	at [soapui-5.7.0.jar:5.7.0]
	at [soapui-5.7.0.jar:5.7.0]
	at [soapui-5.7.0.jar:5.7.0]
	at java.util.concurrent.Executors$ [?:?]
	at [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
	at java.util.concurrent.ThreadPoolExecutor$ [?:?]
	at [?:?]


Can anyone help me here ?

  • I solved it myself.

    Changed the volume destination of the ext folder in docker command.


1 Reply

  • Yurie's avatar
    New Contributor

    I solved it myself.

    Changed the volume destination of the ext folder in docker command.