Forum Discussion

IvanB's avatar
IvanB
Occasional Contributor
7 years ago

Can't register MongoDB jdbc driver to use with JDBC test step in SoapUI

I need connect to MongoDB instance during my tests to execute some queries. I order to achieve that I made the following:

 

1. Added latest MongoDB Java driver jar file mongo-java-driver-3.5.0.jar to java/app/bin/ext/ and java/app/lib (second one just in case, I'm working on Mac).

 

2. Created new JDBC Driver entity:

3. Created a connection entity in environment with host:port:table_name.

4. Created a JDBC Test step with query.

When ReadyAPI starts I see the following:

Wed Nov 15 15:36:41 EST 2017:INFO:Adding [/Applications/ReadyAPI-2.0.2.app/Contents/Resources/app/bin/ext/mongodb-driver-3.5.0.jar] to extensions classpath
Wed Nov 15 15:36:41 EST 2017:INFO:Adding [/Applications/ReadyAPI-2.0.2.app/Contents/Resources/app/bin/ext/mysql-connector-java-5.1.40-bin.jar] to extensions classpath
Wed Nov 15 15:36:41 EST 2017:INFO:Adding [/Applications/ReadyAPI-2.0.2.app/Contents/Resources/app/bin/ext/ojdbc6.jar] to extensions classpath
Wed Nov 15 15:36:41 EST 2017:INFO:Adding [/Applications/ReadyAPI-2.0.2.app/Contents/Resources/app/bin/ext/postgresql-9.3-1102.jdbc41.jar] to extensions classpath
Wed Nov 15 15:36:41 EST 2017:INFO:Adding [/Applications/ReadyAPI-2.0.2.app/Contents/Resources/app/bin/ext/sqljdbc42.jar] to extensions classpath
Wed Nov 15 15:36:41 EST 2017:INFO:Registered 5 JDBC drivers from extensions directory: [com.mysql.jdbc.Driver, com.mysql.fabric.jdbc.FabricMySQLDriver, oracle.jdbc.OracleDriver, org.postgresql.Driver, com.microsoft.sqlserver.jdbc.SQLServerDriver]

So driver is added to class path but not registered.

And then I try to test connection to db I got the following:

 

Wed Nov 15 15:38:10 EST 2017:ERROR:An error occurred when getting a driver for the connection string [jdbc:mongo://XXXX:27017/Table].
Wed Nov 15 15:38:10 EST 2017:ERROR:java.sql.SQLException: No suitable driver
   java.sql.SQLException: No suitable driver
   	at java.sql.DriverManager.getDriver(DriverManager.java:315)
   	at com.eviware.soapui.support.jdbc.JdbcUtils.initConnection(JdbcUtils.java:55)
   	at com.eviware.soapui.impl.wsdl.support.connections.DefaultDatabaseConnectionContainer.testDatabaseConnection(DefaultDatabaseConnectionContainer.java:225)

I've searched this community and googled this problem, but no luck. Anyone knows what I'm doing wrong?

I tried native mongo driver and different versions of jdbc driver. Also tried different variants of driver class with no result.

 

9 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Copy the library under READYAPI_HOME/bin/ext and restart the tool. Please see if that helps.
    • IvanB's avatar
      IvanB
      Occasional Contributor

      This didn't help. I mentioned in my initial message that I've put driver .jar file in /bin/ext folder.