db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (DERBY-4913) 10.3 to 10.5 upgrade fails with ava.io.StreamCorruptedException: java.lang.ClassCastException: org.apache.derby.catalog.types.OldRoutineType incompatible with org.apache.derby.iapi.types.DataTypeDescriptor
Date Fri, 10 Dec 2010 22:01:05 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12970321#action_12970321
] 

Kathey Marsden edited comment on DERBY-4913 at 12/10/10 5:00 PM:
-----------------------------------------------------------------

I got the nested exception back  after the initcause patch which is 

	... 63 more
Caused by: java.lang.ClassCastException: org.apache.derby.catalog.types.OldRoutineType incompatible
with org.apache.derby.iapi.types.DataTypeDescriptor
	at org.apache.derby.impl.sql.GenericColumnDescriptor.readExternal(GenericColumnDescriptor.java:223)
	at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:126)
	... 69 more

 * Read this object from a stream of stored objects.
	 *
	 * @param in read this.
	 *
	 * @exception IOException					thrown on error
	 * @exception ClassNotFoundException		thrown on error
	 */
	public void readExternal(ObjectInput in) 
		throws IOException, ClassNotFoundException
	{
		FormatableHashtable fh = (FormatableHashtable)in.readObject();		
		name = (String)fh.get("name");
		tableName = (String)fh.get("tableName");
		schemaName = (String)fh.get("schemaName");
		columnPos = fh.getInt("columnPos");
		type = (DataTypeDescriptor)fh.get("type");
		isAutoincrement = fh.getBoolean("isAutoincrement");
		updatableByCursor = fh.getBoolean("updatableByCursor");
	}
	

Mike said this to me, which looks like a good clue:


This kind of code exists:   /**
    * Old releases (10.3 and before) wrote out the runtime
    * DataTypeDescriptor for routine parameter and return types.
    * 10.4 onwards (DERBY-2775) always writes out the catalog
    * type TypeDescriptor. Here we see what object was read from
    * disk and if it was the old type, now mapped to OldRoutineType,
    * we extract the catalog type and use that.
    *
    * @param onDiskType The object read that represents the type.
    * @return A type descriptor.
    */
   private static TypeDescriptor getStoredType(Object onDiskType)
   {
       if (onDiskType instanceof OldRoutineType)
           return ((OldRoutineType) onDiskType).getCatalogType();
       return (TypeDescriptor) onDiskType;
   }
key might be to figure out if this code should also be in GenericResultDescription.



Still working to get a local reproduction.

      was (Author: kmarsden):
    I got the nested exception back  after the initcause patch which is 

	... 63 more
Caused by: java.lang.ClassCastException: org.apache.derby.catalog.types.OldRoutineType incompatible
with org.apache.derby.iapi.types.DataTypeDescriptor
	at org.apache.derby.impl.sql.GenericColumnDescriptor.readExternal(GenericColumnDescriptor.java:223)
	at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:126)
	... 69 more

 * Read this object from a stream of stored objects.
	 *
	 * @param in read this.
	 *
	 * @exception IOException					thrown on error
	 * @exception ClassNotFoundException		thrown on error
	 */
	public void readExternal(ObjectInput in) 
		throws IOException, ClassNotFoundException
	{
		FormatableHashtable fh = (FormatableHashtable)in.readObject();		
		name = (String)fh.get("name");
		tableName = (String)fh.get("tableName");
		schemaName = (String)fh.get("schemaName");
		columnPos = fh.getInt("columnPos");
		type = (DataTypeDescriptor)fh.get("type");
		isAutoincrement = fh.getBoolean("isAutoincrement");
		updatableByCursor = fh.getBoolean("updatableByCursor");
	}
	

Mike said this to me, which looks like a good clue:


his kind of code exists:
11:14:12 AM: matrigal@us.ibm.com - Mike Matrigali/Oakland/IBM:    /**
    * Old releases (10.3 and before) wrote out the runtime
    * DataTypeDescriptor for routine parameter and return types.
    * 10.4 onwards (DERBY-2775) always writes out the catalog
    * type TypeDescriptor. Here we see what object was read from
    * disk and if it was the old type, now mapped to OldRoutineType,
    * we extract the catalog type and use that.
    *
    * @param onDiskType The object read that represents the type.
    * @return A type descriptor.
    */
   private static TypeDescriptor getStoredType(Object onDiskType)
   {
       if (onDiskType instanceof OldRoutineType)
           return ((OldRoutineType) onDiskType).getCatalogType();
       return (TypeDescriptor) onDiskType;
   }
key might be to figure out if this code should also be in GenericResultDescription.



Still working to get a local reproduction.
  
> 10.3 to 10.5 upgrade fails with ava.io.StreamCorruptedException: java.lang.ClassCastException:
org.apache.derby.catalog.types.OldRoutineType incompatible with org.apache.derby.iapi.types.DataTypeDescriptor
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4913
>                 URL: https://issues.apache.org/jira/browse/DERBY-4913
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: ClassLoaderUpgrade.java, derby-4913_initcause_diff.txt
>
>
> I have a report from a user upgrading to 10.5 from 10.3 that they got the following error
during upgrade. I don't have much in the way of details yet, but thought I would post an issue
since I've never seen this error before.  I do have the original 10.3 database and it seems
to upgrade fine to 10.5 with ij.  
>     java.sql.SQLException: Failed to start database 
> '/
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException
> (Unknown Source)
>        at 
> org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
> Source)
>        at 
> org.apache.derby.impl.jdbc.Util.seeNextException(Unknown 
> Source)
>        at 
> org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown 
> Source)
>        at 
> org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown 
> Source)
>        at 
> org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown 
> Source)
>        at 
> org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown 
> Source)
>        at 
> org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown 
> Source)
>        at org.apache.derby.jdbc.InternalDriver.connect(Unknown 
> Source)
>        at 
> org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown 
> Source)
>        at 
> org.apache.derby.jdbc.EmbedPooledConnection.openRealConnection(U
> nknown Source)
>        at 
> org.apache.derby.jdbc.EmbedPooledConnection.<init>(Unknown 
> Source)
>        at 
> org.apache.derby.jdbc.EmbedPooledConnection40.<init>(Unknown 
> Source)
>        at 
> org.apache.derby.jdbc.Driver40.getNewPooledConnection(Unknown 
> Source)
>        at 
> org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource.createPoo
> ledConnection(Unknown Source)
>        at 
> org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource.getPooled
> Connection(Unknown Source)
>        at 
> <snip>
>     Caused by: java.sql.SQLException: Failed to start database 
> '<snip>759243AF2F8
> 4F1DE' with class loader <snip>.ExtClassLoader@3e955f6, see the next 
> exception for details.
>        at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(U
> nknown Source)
>        at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTran
> sportAcrossDRDA(Unknown Source)
>        ... 41 more
>     Caused by: java.sql.SQLException: Exception during restore 
> of a serializable or SQLData object of class 
>        at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(U
> nknown Source)
>        at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTran
> sportAcrossDRDA(Unknown Source)
>        at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException
> (Unknown Source)
>        at 
> org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown 
> Source)
>        ... 38 more
>     Caused by: ERROR XSDA8: Exception during restore of a 
> serializable or SQLData object of class 
>        at 
> org.apache.derby.iapi.error.StandardException.newException(Unkno
> wn Source)
>        at 
> org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromAr
> ray(Unknown Source)
>        at 
> org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFro
> mSlot(Unknown Source)
>        at 
> org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(Unkn
> own Source)
>        at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanContr
> oller.fetchRows(Unknown Source)
>        at 
> org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(Unkno
> wn Source)
>        at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescript
> orViaHeap(Unknown Source)
>        at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDe
> scriptors(Unknown Source)
>        at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMet
> adataSPSes(Unknown Source)
>        at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetad
> ataSPSes(Unknown Source)
>        at 
> org.apache.derby.impl.sql.catalog.DD_Version.doFullUpgrade(Unkno
> wn Source)
>        at 
> org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(Unk
> nown Source)
>        at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDiction
> aryTables(Unknown Source)
>        at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(Unknow
> n Source)
>        at 
> org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown 
> Source)
>        at 
> org.apache.derby.impl.services.monitor.TopService.bootModule(Unk
> nown Source)
>        at 
> org.apache.derby.impl.services.monitor.BaseMonitor.startModule(U
> nknown Source)
>        at 
> org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule
> (Unknown Source)
>        at org.apache.derby.impl.db.BasicDatabase.boot(Unknown 
> Source)
>        at 
> org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown 
> Source)
>        at 
> org.apache.derby.impl.services.monitor.TopService.bootModule(Unk
> nown Source)
>        at 
> org.apache.derby.impl.services.monitor.BaseMonitor.bootService(U
> nknown Source)
>        at 
> org.apache.derby.impl.services.monitor.BaseMonitor.startProvider
> Service(Unknown Source)
>        at 
> org.apache.derby.impl.services.monitor.BaseMonitor.findProviderA
> ndStartService(Unknown Source)
>        at 
> org.apache.derby.impl.services.monitor.BaseMonitor.startPersiste
> ntService(Unknown Source)
>        at 
> org.apache.derby.iapi.services.monitor.Monitor.startPersistentSe
> rvice(Unknown Source)
>        ... 38 more
>     Caused by: java.io.StreamCorruptedException: 
> java.lang.ClassCastException: 
> org.apache.derby.catalog.types.OldRoutineType incompatible with 
> org.apache.derby.iapi.types.DataTypeDescriptor
>        at 
> org.apache.derby.iapi.services.io.FormatIdInputStream.readObject
> (Unknown Source)
>        at 
> org.apache.derby.impl.sql.GenericResultDescription.readExternal(
> Unknown Source)
>        at 
> org.apache.derby.iapi.services.io.FormatIdInputStream.readObject
> (Unknown Source)
>        at 
> org.apache.derby.impl.sql.GenericStorablePreparedStatement.readE
> xternal(Unknown Source)
>        at 
> org.apache.derby.iapi.services.io.FormatIdInputStream.readObject
> (Unknown Source)
>        at 
> org.apache.derby.iapi.types.UserType.readExternal(Unknown 
> Source)
>        ... 63 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message