<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Deserialization - ClassCastException after datatype of a Custom class changed in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237964#M191094</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi bhola!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's not activiti specific (de)serialization, just java (de)serialization.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In general if you set serialverionUID, serialization survives addition/deletion of fields, but not&amp;nbsp; field type changes .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For this particular case&amp;nbsp; you can create new field instead of changing its type. Coverage with getter/setter can hide old field from outer classes… well, for JAXB and similar reflection-field-access tools you'll have to tweak annotations (make old field transient, make sure new field is initialized or accessed through getter/setter), but it's not activiti problem. Also you can derive new field value out of old field value if needed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;—&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can change blob serialized in ACT_GE_BYTEARRAY if you can find every occurence of your type variables in all history and running processes. You'll have to read blob, deserialize it into old class, transform it into new class and save blob. Probably you'll need different class loader for new class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also derive custom (de)serialization methods for class, saving its version (or serialization options) and (de)serializing some fields differently for different versions. Unfortunately it's not generally compatible to streams that were created without custom serialization as version info should be saved into that same stream in addition to normal data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Oct 2016 14:40:49 GMT</pubDate>
    <dc:creator>warper</dc:creator>
    <dc:date>2016-10-05T14:40:49Z</dc:date>
    <item>
      <title>Deserialization - ClassCastException after datatype of a Custom class changed</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237963#M191093</link>
      <description>Hi All,Recently I changed the datatype of a variable in a custom class from Integer to Double. When I start processing the older applications activiti is throwing classcastexception while assigning Integer to Double.Could anybody can help me how to get rid of this problem in activiti based applicati</description>
      <pubDate>Wed, 05 Oct 2016 09:56:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237963#M191093</guid>
      <dc:creator>bhola</dc:creator>
      <dc:date>2016-10-05T09:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Deserialization - ClassCastException after datatype of a Custom class changed</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237964#M191094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi bhola!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's not activiti specific (de)serialization, just java (de)serialization.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In general if you set serialverionUID, serialization survives addition/deletion of fields, but not&amp;nbsp; field type changes .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For this particular case&amp;nbsp; you can create new field instead of changing its type. Coverage with getter/setter can hide old field from outer classes… well, for JAXB and similar reflection-field-access tools you'll have to tweak annotations (make old field transient, make sure new field is initialized or accessed through getter/setter), but it's not activiti problem. Also you can derive new field value out of old field value if needed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;—&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can change blob serialized in ACT_GE_BYTEARRAY if you can find every occurence of your type variables in all history and running processes. You'll have to read blob, deserialize it into old class, transform it into new class and save blob. Probably you'll need different class loader for new class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also derive custom (de)serialization methods for class, saving its version (or serialization options) and (de)serializing some fields differently for different versions. Unfortunately it's not generally compatible to streams that were created without custom serialization as version info should be saved into that same stream in addition to normal data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2016 14:40:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237964#M191094</guid>
      <dc:creator>warper</dc:creator>
      <dc:date>2016-10-05T14:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Deserialization - ClassCastException after datatype of a Custom class changed</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237965#M191095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Warper,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your quick suggestions and answers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please provide little more insight if there is anyway to customize activiti process of serializing and deserializing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bhola&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 06:55:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237965#M191095</guid>
      <dc:creator>bhola</dc:creator>
      <dc:date>2016-10-06T06:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Deserialization - ClassCastException after datatype of a Custom class changed</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237966#M191096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Bhola!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't think it's customizable in activiti code. As far as I remember, activiti calls ibatis that makes some things depending on underlying database, but in the end it calls standard serialization readObject/writeObject to create blob that goes through JDBC connection to database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So you can customize your class serialization mechanics if needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.oracle.com/technetwork/articles/java/javaserial-1536170.html" rel="nofollow noopener noreferrer"&gt;http://www.oracle.com/technetwork/articles/java/javaserial-1536170.html&lt;/A&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 13:40:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deserialization-classcastexception-after-datatype-of-a-custom/m-p/237966#M191096</guid>
      <dc:creator>warper</dc:creator>
      <dc:date>2016-10-06T13:40:05Z</dc:date>
    </item>
  </channel>
</rss>

