我使用ant脚本创建了JDBC连接池。
<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>
一切正常,直到我尝试从DB检索ARRAY。我收到以下错误:
java.lang.ClassCastException: weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY cannot be cast to oracle.sql.ARRAY
我在这个link中得到了这个问题的解决方案,它说连接池的Wrap数据类型应设置为false。这解决了这个问题。 但是当我尝试将该属性添加到我的蚂蚁脚本
时<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 :(得分:0)
在这种情况下,您似乎使用通用接口,脚本执行程序不了解供应商特定标志。尝试使用混凝土类型。可能是weblogic.jdbc.common.internal.ConnectionPool会帮助你。