Saturday, September 13, 2014

Oracle SOA 12C - Migrating projects with DB adapter returning XMLTYPE

While migrating SOA composites containing DB adpaters which calls stored procedures in Oracle database returning XMLTYPE from SOA suite 11g to 12c an error similar to the below may be noticed.


</faultType> 
-<bindingFault xmlns="http://schemas.oracle.com/bpel/extension"> 
-<part name="summary"> 
<summary> 

Exception occurred when binding was invoked. 
Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation '*******' failed due to: Object XML conversion error. 
An error occurred while converting a Java object to XML. 
Unable to convert the XSD element ***** whose JDBC type is OPAQUE to a corresponding XML document element. Cause: java.lang.ClassCastException: weblogic.jdbc.wrapper.WrapperSQLXML_oracle_xdb_XMLType cannot be cast to oracle.sql.OPAQUE 
Analyze the error and correct if possible. Contact oracle support if error is not fixable. This exception is considered not retriable, likely due to a modelling mistake. 
". 
The invoked JCA adapter raised a resource exception. 
Please examine the above error message carefully to determine a resolution. 

</summary> 
</part> 
-<part name="detail"> 
<detail> 

weblogic.jdbc.wrapper.WrapperSQLXML_oracle_xdb_XMLType cannot be cast to oracle.sql.OPAQUE 

</detail> 
</part> 
-<part name="code"> 
<code> 

null 

</code> 
</part> 
</bindingFault> 
</bpelFault>
 

The problem is that in 11G the wizard creates the schema elements as SYS.XMLTYPE for XML type parameters whereas in 12C it should be PUBLIC.XMLTYPE.So changing this in database adapter schema will resolve the issue.

For example,

from

<complexType> 
<sequence> 
<element name="P_XML_VALUE" type="db:SYS.XMLTYPE" db:index="2" db:type="Opaque" minOccurs="0" nillable="true"/> 
</sequence> 
</complexType>

to


<complexType> 
<sequence> 
<element name="P_XML_VALUE" type="db:PUBLIC.XMLTYPE" db:index="2" db:type="Opaque" minOccurs="0" nillable="true"/> 
</sequence> 
</complexType>



10 comments:

  1. Hello.
    Where can I find the database adapter schema?
    Thanks.

    ReplyDelete
  2. I solved the problem by disabling "Wrap Data Type" checkbox in "Connection Pool" tab advanced section.
    Afterwards you'll have to restart the WLS.

    ReplyDelete
    Replies
    1. Yes that can improve the performance also by disabling debugging output and the tracking of weblogic connection utilization..

      Delete
    2. Thanks, that solved the same issue we had when porting to WebLogic 12.
      #### <[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <1475584316977> <[severity-value: 1] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <weblogic.jdbc.wrapper.WrapperSQLXML_oracle_xdb_XMLType cannot be cast to oracle.sql.OPAQUE
      java.lang.ClassCastException: weblogic.jdbc.wrapper.WrapperSQLXML_oracle_xdb_XMLType cannot be cast to oracle.sql.OPAQUE

      Delete