1

After updating maven plugin to version 5.1.2 I get an error message

$ERROR [SoapUI] An error occurred [No suitable driver found for jdbc:oracle:thin:@//174.23.0.187:1111/qwe], see error log for details
java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@//174.23.0.187:1111/qwe
    at java.sql.DriverManager.getConnection(DriverManager.java:596)
    at java.sql.DriverManager.getConnection(DriverManager.java:215)
    at groovy.sql.Sql.newInstance(Sql.java:398)
    at groovy.sql.Sql.newInstance(Sql.java:442)
    at groovy.sql.Sql$newInstance.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
...
Jens
  • 67,715
  • 15
  • 98
  • 113
Happy
  • 79
  • 1
  • 2
  • 15

3 Answers3

2

register JDBC driver solved the issue com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( "oracle.jdbc.OracleDriver" )

Happy
  • 79
  • 1
  • 2
  • 15
1

You need to include oracle jdbc driver to your classpath, which you can download from here

Since you've a maven project the most normal thing to do was to simply include the dependency in your pom.xml, however due to the oracle jdbc licence there is no public repository with this jar, however recently (a few days ago) oracle adds this jar to their repository. You can try with it following the details on oracle blog (note that user auth is required and maven version 3.2.5 o higher).

albciff
  • 18,112
  • 4
  • 64
  • 89
  • 1
    Typical Oracle: so they create a Maven repo, but lock it up ... so it makes it painful to use with a project. Good to know in any case. – SiKing Mar 01 '16 at 16:43
1

In case you do not want to use the password locked Oracle repo, you can do the following:

  1. Download the O-JDBC from Oracle.

  2. Place it in your project. Somewhere like a lib directory.

  3. Use the maven-install-plugin to install the jar in your local repo. Something like this:

    <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.4</version>
        <executions>
            <execution>
                <id>install-ojdbc7</id>
                <phase>pre-integration-test</phase>
                <configuration>
                    <file>lib/ojdbc7.jar</file>
                    <repositoryLayout>default</repositoryLayout>
                    <groupId>oracle.jdbc</groupId>
                    <artifactId>ojdbc7</artifactId>
                    <version>12.1.0.2.0</version>
                    <packaging>jar</packaging>
                    <generatePom>true</generatePom>
                </configuration>
                <goals>
                    <goal>install-file</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    

The details of how this works are discussed little further here.

  1. For your SoapUI, you will then need to link in the dependency:

    <plugin>
        <groupId>com.smartbear.soapui</groupId>
        <artifactId>soapui-maven-plugin</artifactId>
        <version>${soapui-maven-plugin.version}</version>
        <dependencies>
            <dependency>
                <groupId>oracle.jdbc</groupId>
                <artifactId>ojdbc7</artifactId>
                <version>12.1.0.2.0</version>
            </dependency>
        </dependencies>
        <executions>
            <execution>
                <phase>integration-test</phase>
                <goals>
                    <goal>test</goal>
                </goals>
                <configuration>
                ...
                </configuration>
            </execution>
        </executions>
    </plugin>
    
  2. I am using mvn verify to run all this.

Community
  • 1
  • 1
SiKing
  • 10,003
  • 10
  • 39
  • 90