Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6314

Upgrade from 10.10 fails with ClassCastException

    XMLWordPrintableJSON

Details

    • Urgent
    • Regression

    Description

      I noticed that after running the SignatureChecker tool on a database with version 10.10.1.1, I could not boot it with trunk (neither hard nor soft upgrade worked).

      To reproduce, create a database and run SignatureChecker with 10.10:

      $ java -jar /code/derby/oldreleases/10.10.1.1/derbyrun.jar SignatureChecker 'jdbc:derby:db;create=true'

      Then, try to boot that database with trunk:

      $ java -Dderby.database.allowPreReleaseUpgrade=true -jar /code/derby/trunk/jars/sane/derbyrun.jar SignatureChecker 'jdbc:derby:db'
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.derby.tools.SignatureChecker.getJ2SEConnection(SignatureChecker.java:445)
      at org.apache.derby.tools.SignatureChecker.execute(SignatureChecker.java:140)
      at org.apache.derby.tools.SignatureChecker.main(SignatureChecker.java:121)
      at org.apache.derby.iapi.tools.run.main(run.java:61)
      Caused by: java.sql.SQLException: Failed to start database 'db' with class loader sun.misc.Launcher$AppClassLoader@7e820d53, see the next exception for details.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:103)
      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:137)
      at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:310)
      at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2841)
      at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:404)
      at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(InternalDriver.java:628)
      at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:282)
      at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:913)
      at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:147)
      at java.sql.DriverManager.getConnection(DriverManager.java:571)
      at java.sql.DriverManager.getConnection(DriverManager.java:233)
      ... 8 more
      Caused by: java.sql.SQLException: Failed to start database 'db' with class loader sun.misc.Launcher$AppClassLoader@7e820d53, see the next exception for details.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:141)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:73)
      ... 18 more
      Caused by: java.sql.SQLException: Exception during restore of a serializable or SQLData object of class
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:141)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:73)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:288)
      at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2835)
      ... 15 more
      Caused by: ERROR XSDA8: Exception during restore of a serializable or SQLData object of class
      at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:265)
      at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5827)
      at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
      at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:441)
      at org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
      at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.fetch(GenericConglomerateController.java:299)
      at org.apache.derby.impl.sql.catalog.TabInfoImpl.deleteRows(TabInfoImpl.java:725)
      at org.apache.derby.impl.sql.catalog.TabInfoImpl.deleteRow(TabInfoImpl.java:570)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropSPSDescriptor(DataDictionaryImpl.java:4673)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropSPSDescriptor(DataDictionaryImpl.java:4647)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:14121)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:14135)
      at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:539)
      at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:238)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7984)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:818)
      at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1991)
      at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:541)
      at org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:44)
      at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:423)
      at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:196)
      at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1991)
      at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
      at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1819)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1685)
      at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1569)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:988)
      at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:546)
      at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2802)
      ... 15 more
      Caused by: java.io.StreamCorruptedException: java.lang.ClassCastException: java.io.ObjectInputStream cannot be cast to org.apache.derby.iapi.services.io.ErrorInfo
      at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:139)
      at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:180)
      at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:232)
      at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
      at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:299)
      at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5684)
      ... 43 more
      Caused by: java.lang.ClassCastException: java.io.ObjectInputStream cannot be cast to org.apache.derby.iapi.services.io.ErrorInfo
      at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:97)
      ... 48 more
      Could not get a connection.

      Attachments

        1. d6314-1a.diff
          3 kB
          Knut Anders Hatlen
        2. d6314-2a.diff
          9 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: