3 Replies Latest reply on Feb 27, 2003 1:44 PM by Erik Turesson

    Change of package structure for Blob implementation?

    Erik Turesson Novice


      I have a number of CMP 2.0 beans that has fields of the type Blob. I have implemented my own implementation of the Blob class. It implements the java.sql.Blob interface.
      This works fine.

      My problem is that I have changed company and whant to rename my Blob implementation from com.companyA.Blob to com.companyB.Blob.

      The problem is when I deploy my application on a database created with the old implementation. Then I will get errors about that it cant find the com.companyA.Blob class.

      Can this be solwed or do I have to live with the old package structure?


        • 1. Re: Change of package structure for Blob implementation?
          Erik Turesson Novice


          I am still having problem with my blobs.
          Now I would like to try JBoss using JDK1.4.
          Since the java.sql.Blob interface have changed between 1.3 and 1.4 I have to change and recompile my blob implementation.

          If I start from a clean database everything is ok, but if I am using an existing database, created with jdk 1.3.1 then I am getting the following error:

          2003-02-27 15:47:13,215 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException, causedBy:
          java.sql.SQLException: Unable to load to deserialize result: java.io.InvalidClassException: com.proventek.scj.util.ByteArrayBlob; local class incompatible: stream classdesc serialVersionUID = 832987368681186065, local class serialVersionUID = 1501205439159683714
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.convertToObject(JDBCUtil.java:753)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.getResult(JDBCUtil.java:360)
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:359)
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:312)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:147)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
          at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
          at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:252)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
          at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:90)
          at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:168)
          at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
          at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
          at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
          at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:92)
          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
          at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
          at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
          at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
          at $Proxy147.getId(Unknown Source)

          What to do?


          • 2. Re: Change of package structure for Blob implementation?
            Erik Turesson Novice

            Hello again!

            The problem does actually occure even if I compile it with JDK 1.3.1 and just add some metthods to the implementation.

            Should it be like that?
            If so, how shall I implement a blob attribute.


            • 3. Re: Change of package structure for Blob implementation?
              Erik Turesson Novice


              Now I have understood what I have done.
              I have note actually stored a blob, I have been storing an object with a byte[] inside. If I then changes the interface of my object then it can not be fetched from the database.

              I have now changed my implementation to not implement the java.sql.Blob interface. My implementation is now very minimalistic to avoid changes in the future.