2013-08-06 21 views
0

我使用ant腳本創建了JDBC連接池。無法使用wlconfig爲JDBCConnectionPool設置WrapTypes

<target name="create-cmifs-connpool"> 
    <wlconfig username="${user}" password="${password}" url="${wls.url}"> 
     <query domain="${domain.name}" type="Server" name="${servername}" property="x" /> 
     <create type="JDBCConnectionPool" name="cmifsDBPool"> 
      <set attribute="CapacityIncrement" value="1"/> 
      <set attribute="DriverName" value="oracle.jdbc.OracleDriver"/> 
      <set attribute="InitialCapacity" value="1"/> 
      <set attribute="MaxCapacity" value="10"/> 
      <set attribute="Password" value="${env.DB_PWD}"/> 
      <set attribute="Properties" value="user=${env.DB_USER}"/> 
      <set attribute="RefreshMinutes" value="0"/> 
      <set attribute="ShrinkPeriodMinutes" value="15"/> 
      <set attribute="ShrinkingEnabled" value="true"/> 
      <set attribute="TestConnectionsOnRelease" value="false"/> 
      <set attribute="TestConnectionsOnReserve" value="false"/> 
      <set attribute="TestTableName" value="DUAL"/> 
      <set attribute="URL" value="jdbc:oracle:thin:@${env.MACHINE}:1521:NOTXE"/> 
      <set attribute="Targets" value="${x}" /> 
     </create> 

     <create type="JDBCDataSource" name="cmifsDBDS" > 
      <set attribute="JNDIName" value="jdbc/cmifsDBDS"/> 
      <set attribute="PoolName" value="cmifsDBPool"/> 
      <set attribute="Targets" value="${x}" /> 
     </create> 

    </wlconfig> 
</target> 

一切正常,直到我嘗試從數據庫檢索ARRAY。我得到以下錯誤:

java.lang.ClassCastException: weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY cannot be cast to oracle.sql.ARRAY 

我得到了這個link對於這個問題的解決方案,它說,總結數據類型應設置爲false,連接池。這解決了這個問題。 但是,當我試圖將屬性添加到我的ant腳本

<set attribute="WrapTypes" value="false"/> 

它不工作。我收到以下錯誤:

Error invoking MBean command: java.lang.IllegalArgumentException: Property Name and value not valid for the MBean. Value false for parameter[WrapTypes].java.lang.IllegalArgumentException: Unable to find the attribute: WrapTypes in the attribute list of the class: JDBCConnectionPool 

如何解決此問題?

回答

0

看來你使用通用接口和腳本執行程序不理解供應商特定標誌在這種情況下。嘗試使用具體類型。可能是weblogic.jdbc.common.internal.ConnectionPool會幫助你。

+0

你能給我看一個樣品嗎? –