<?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 HistoricDetailVariableInstanceUpdateEntity can not deserialize value using custom ClassLoader in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192218#M145348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help me, please, with custom ClassLoader in ProcessEngineConfigurationImpl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue can be seen on Activiti 5.13 under Alfresco.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In &lt;/SPAN&gt;&lt;SPAN style="color:#006600;"&gt;org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.endNormalTask&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;taskService.complete(localTaskId);&lt;BR /&gt;// The task should have a historicTaskInstance&lt;BR /&gt;HistoricTaskInstance historicTask = historyService.createHistoricTaskInstanceQuery().taskId(task.getId()).singleResult();&lt;BR /&gt;return typeConverter.convert(historicTask); // &amp;lt;— The problem is here&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In &lt;/SPAN&gt;&lt;SPAN style="color:#006600;"&gt;org.alfresco.repo.workflow.activiti.properties.ActivitiPropertyConverter.convertHistoricDetails&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;we see the instructions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;for(Entry&amp;lt;String, HistoricVariableUpdate&amp;gt; entry : updateMap.entrySet())&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; variables.put(entry.getKey(), entry.getValue().getValue());&lt;BR /&gt;}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;when trying to getValue in org.activiti.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;we come to &lt;/SPAN&gt;&lt;SPAN style="color:#006600;"&gt;org.activiti.engine.impl.variable.SerializableType.getValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and then - to org.activiti.engine.impl.util.ReflectUtil.loadClass:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp; Class&amp;lt;?&amp;gt; clazz = null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ClassLoader classLoader = getCustomClassLoader();&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in getCustomClassLoader():&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(processEngineConfiguration != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; final ClassLoader classLoader = processEngineConfiguration.getClassLoader();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(classLoader != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return classLoader;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;at this point we can see that &lt;/SPAN&gt;&lt;SPAN style="color:#006600;"&gt;Context.getProcessEngineConfiguration()&lt;/SPAN&gt;&lt;SPAN&gt; returns &lt;/SPAN&gt;&lt;STRONG&gt;null&lt;/STRONG&gt;&lt;SPAN&gt; (it's always cleared by executed commands in the end of execution).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, we can not use custom ClassLoader, added to ProcessEngineConfigurationImpl, and of course get an java.lang.ClassNotFoundException.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The question is: isn't it a bug, and if not then how to deal with this behavior?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Serge&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jul 2014 15:30:53 GMT</pubDate>
    <dc:creator>smokemaker</dc:creator>
    <dc:date>2014-07-14T15:30:53Z</dc:date>
    <item>
      <title>HistoricDetailVariableInstanceUpdateEntity can not deserialize value using custom ClassLoader</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192218#M145348</link>
      <description>Hi all!Help me, please, with custom ClassLoader in ProcessEngineConfigurationImplThe issue can be seen on Activiti 5.13 under Alfresco.In org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.endNormalTask:taskService.complete(localTaskId);// The task should have a historicTaskInstanceHistoricT</description>
      <pubDate>Mon, 14 Jul 2014 15:30:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192218#M145348</guid>
      <dc:creator>smokemaker</dc:creator>
      <dc:date>2014-07-14T15:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricDetailVariableInstanceUpdateEntity can not deserialize value using custom ClassLoader</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192219#M145349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That looks like a bug indeed. I think the best place to raise the issue would be with Alfresco (community or enterprise).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 10:23:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192219#M145349</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2014-07-21T10:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricDetailVariableInstanceUpdateEntity can not deserialize value using custom ClassLoader</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192220#M145350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tijs, thanks for your reply! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But do you think the Alfresco code should be modified? It seems that Alfresco just uses the Activiti API via HistoryService. Or do they use it in improper way?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Serge&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:06:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192220#M145350</guid>
      <dc:creator>smokemaker</dc:creator>
      <dc:date>2014-07-21T11:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricDetailVariableInstanceUpdateEntity can not deserialize value using custom ClassLoader</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192221#M145351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The Alfresco integration is in a very particular way implemented. That's why Tijs pointed out it's rather on the Alfresco side.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 07:00:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192221#M145351</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-07-25T07:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricDetailVariableInstanceUpdateEntity can not deserialize value using custom ClassLoader</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192222#M145352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is already fixed in current Activiti-releases, having all serialisable variables touched (value cached in the variable instance) before leaving the command-context, when getting them. Unfortunately, this fix is not yet part of the current Alfresco release.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This can be fixed in the Alfresco code as well, IMHO. So best to create an issue, as Tijs suggested.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 07:24:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicdetailvariableinstanceupdateentity-can-not-deserialize/m-p/192222#M145352</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2014-07-25T07:24:47Z</dc:date>
    </item>
  </channel>
</rss>

