1 Reply Latest reply on Mar 31, 2003 5:08 AM by mister_fab

    Blob, Mysql deserialisable error

    johnmcauley

      Hi folks,

      I am using Jboss 3.2 with Mysql and CMP and have run into problems when trying to retrieve a blob. when i use the following

      <cmp-field>
      <field-name>mediaBlob</field-name>
      <column-name>mediaBlob</column-name>
      <jdbc-type>BLOB</jdbc-type>
      <sql-type>BLOB</sql-type>
      </cmp-field>

      in the jbosscmp-jdbc.xml file i recieve the following error when retrieveing the remote interface

      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: EJBException:; nested exception is:
      javax.ejb.EJBException: Internal error getting results for field member mediaBlob; CausedByException is:
      Unable to load to deserialize result: java.io.StreamCorruptedException: invalid stream header
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)

      I solve this problem by using this mapping in the jbosscmp-jdbc.xml

      <cmp-field>
      <field-name>mediaBlob</field-name>
      <column-name>mediaBlob</column-name>
      <jdbc-type>JAVA_OBJECT</jdbc-type>
      <sql-type>BLOB</sql-type>
      </cmp-field>

      But this retrieves an java.lang.object which i am unable to cast to anything useful, without a classcast exception.

      I have placed a blob in the database which is a java.io.File firstly and hence serialized. but still get the errors.

      I am sure that someone outthere can help, much appreciated.....

      John