2016-03-01 67 views
1

更新Maven插件到5.1.2版本後,我得到一個錯誤信息錯誤[了SoapUI]時出現錯誤[發現JDBC沒有合適的驅動程序:神諭:薄:@ // 174.23.0.187:1111/qwe]

$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) 
... 
+1

看起來你在你的classpath – Jens

回答

1

寄存器JDBC驅動程序解決問題 com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("oracle.jdbc.OracleDriver")

1

您需要包括Oracle JDBC驅動程序到你的類路徑中,你可以從here

因爲你已經Maven項目最正常的事情是簡單地在您的pom.xml依賴下載,但是由於對於oracle jdbc許可證,這個jar沒有公共存儲庫,但最近(幾天前),oracle將這個jar添加到他們的存儲庫中。您可以按照oracle blog(請注意,用戶身份驗證是必需的,maven版本3.2.5更高)的詳細信息嘗試使用它。

+1

典型的Oracle錯過了Oracle驅動程序jar:所以他們創造一個Maven回購,但把它關起來......所以它使使用一個項目很痛苦。無論如何都很高興知道。 – SiKing

1

如果你不想使用密碼鎖定甲骨文回購,你可以做到以下幾點:

  1. Oracle下載O型JDBC。

  2. 將它放在你的項目中。某處像lib目錄。

  3. 使用maven-install-plugin將jar安裝在本地倉庫中。事情是這樣的:

    <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> 
    

的這個作品是如何討論遠一點here細節。

  • 爲了您了SoapUI,您將需要在相關鏈接:

    <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> 
    
  • 我使用mvn verify運行這一切。

  • +0

    是安裝在本地倉庫是':)',因爲連接到oracle倉庫對於只有一個罐子來說太痛苦了。 – albciff

    +0

    @albciff甲骨文仍在試圖徹底殺死Java。 :) – SiKing

    相關問題