wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes ClassCastException Weblogic and Oracle CLOB object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "ClassCastException Weblogic and Oracle CLOB object" Watch "ClassCastException Weblogic and Oracle CLOB object" New topic

ClassCastException Weblogic and Oracle CLOB object

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
My web application uses Weblogic connection pool for database activities.
I am using Oracle database.

I have a jar file / class file which has the following piece of code, which my application uses.

Please remember i can't modify the above line of code.

When i am running the application i am getting the below error...

It seems like weblogic returns the object 'weblogic.jdbc.wrapper.Clob_oracle_sql_CLOB', rather than the 'oracle.sql.CLOB' which i am expecting.

Is there any way i can force the weblogic to return the object i am expecting,
since i can't modify the above piece of code, in which case, i can cast it to 'weblogic.jdbc.wrapper.Clob_oracle_sql_CLOB'.

Any help would be appreciated....
Dieter Hubau

Joined: Apr 14, 2010
Posts: 2
At the risk of being redundant, I can finally answer this one :-)

Weblogic wraps all special data types like LOB, CLOBs, etc.. in wrapper classes before returning them. Weblogic does this by default.

You can turn this option off as explained in below article:

I agree. Here's the link: http://aspose.com/file-tools
subject: ClassCastException Weblogic and Oracle CLOB object
Similar Threads
Migration from Oracle to Weblogic and CLOB ClassCastException
Reading CLOB object from Oracle
Oracle Clob error on shared Sun One connection pool
clob.setCharacterStream(1); Unsupported feature
how to convert weblogic.jdbc.wrapper.Clob_weblogic_jdbc_base_Base Clob to oracle.sql.Clob