3 Replies Latest reply on Apr 19, 2013 10:03 AM by matukituki

    jboss 7.1 how to solve "Blobs may not be accessed after serialization" error with hibernate 4

    matukituki

      Hi,

       

      I'm migrating an application from JBoss 5.1 to JBoss 7.1.

       

      I'm facing the following problem "Blobs may not be accessed after serialization". I had solved the problem in JBoss 5.1 using org.hibernate.lob.SerializableBlob class.

       

      The hibernate4 jars used by JBoss 7.1 do not contain this class.

       

      I have seen through the classes of the org.hibernate.engine.jdbc package of the hibernate-core-4.0.1.Final.jar bunbled with the JBoss 7.1 and I have tried the following with no luck:

       

      NonContextualLobCreator lobCreator = NonContextualLobCreator.INSTANCE;
      WrappedBlob blobSerialized = (WrappedBlob) lobCreator.wrap((Blob) result[1]);
      Blob theBlob = blobSerialized.getWrappedBlob();
      

       

      But I'm getting the same error when retrieving  the binary stream from the blob variable

       

      theBlob.getBinaryStream()...
      

       

      I have google it for two days but I couldn't find something useful.

      I have also tried in the hibernate forums.

       

      Any help would be appreciated.

       

      Thanks.