Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Accessing Clob in CMP EJB

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to retrieve CLOB through CMP in Websphere.
I get the below exception when I try to get the localInterface which contains CLOB field in my facade by using the findByPrimary Key method.
java.lang.RuntimeException: InputStream does not contain a serialized object
at com.ibm.vap.converters.streams.VapBinaryStreamToSerializableObjectConverter.objectFrom(VapBinaryStreamToSerializableObjectConverter.java:57)
I am wondering if it is possible getting Clob through CMP in EJB.
BTW I have tried using both String and CLOB as CMP field types matching to CLOB in Oracle DB.

Thanks....
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to change the converter that is in use on this field. The error is telling you that this CLOB does not contain a serialized object -- which from what you're telling us is right.
Go to the properties view of the mapping editor (down at the bottom of the page) and try changing the converter (under "transformation") to a "VapBinaryStreamtoByteArrayConverter", and then change the field type you are mapping it to to a ByteArray if you want to treat it as a byte array.
If you wanted to treat it as a String, try changing the field type to String and using a "VapAsciiStreamtoStringConverter".
The hows and whys of converters are covered in the Advanced EJB mapping chapter of my book, by the way...
Kyle
 
Ajai
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the solution.
 
A wop bop a lu bop a womp bam boom! Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic