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
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
I solve this problem by using this mapping in the jbosscmp-jdbc.xml
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.....
Are you using the last mySql JDBC drivers ? I had some problem to store CLOB jdbc type field in a mySql database because of some feature not implemented in the jdbc 2.0 driver and using the last stable release (http://www.mysql.com/downloads/api-jdbc.html) has solved this problem.