<?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: Setting a context classloader when calling client code in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29295#M14969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Tom,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand your concerns. Just out of curiosity, what exactly do you mean by "cloud"? Sth. like this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://aws.amazon.com/elasticbeanstalk/" rel="nofollow noopener noreferrer"&gt;http://aws.amazon.com/elasticbeanstalk/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you suggested: &lt;/SPAN&gt;&lt;A href="http://docs.codehaus.org/display/ACT/Activiti+Classloading" rel="nofollow noopener noreferrer"&gt;http://docs.codehaus.org/display/ACT/Activiti+Classloading&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Apr 2011 07:46:51 GMT</pubDate>
    <dc:creator>meyerd</dc:creator>
    <dc:date>2011-04-08T07:46:51Z</dc:date>
    <item>
      <title>Setting a context classloader when calling client code</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29288#M14962</link>
      <description>In ReflectUtil we currently use the custom classloader (ProcessEngineConfiguration.getClassLoader()) for loading JavaDelegate-Classes. Don't we need to set that ClassLoader as a context-classloader on the current thread when we call the clientcode?One scenario where it is needed is when we are runni</description>
      <pubDate>Sun, 03 Apr 2011 14:08:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29288#M14962</guid>
      <dc:creator>meyerd</dc:creator>
      <dc:date>2011-04-03T14:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a context classloader when calling client code</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29289#M14963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To clarify, I am thinking about sth like this: (org.activiti.engine.impl.bpmn.behavior.ServiceTaskJavaDelegateActivityBehavior)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;public void execute(DelegateExecution execution) throws Exception {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ClassLoader classLoaderBefore = Thread.currentThread().getContextClassLoader();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set the classloader which loaded the delegate as context classloader for the call to the client-code&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.currentThread().setContextClassLoader(javaDelegate.getClass().getClassLoader());&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; javaDelegate.execute(execution);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }finally {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.currentThread().setContextClassLoader(classLoaderBefore);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; }&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 08:20:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29289#M14963</guid>
      <dc:creator>meyerd</dc:creator>
      <dc:date>2011-04-04T08:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a context classloader when calling client code</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29290#M14964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks valid. But…&amp;nbsp; I don't have a complete overview to ensure that implementing this will lead to the next problem with classloaders, security and other complex aspects. So I think this is a pandora s box.&amp;nbsp; Seems reasonable, but my experience tells me there is a lot more that can be dragged in eventually.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the other hand, this is not crucial for us and it makes our codebase more complex.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And third, users can embed that piece of code in their own delegate classes if they really want to.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So all that together makes me think it's better to stay away from this kind of features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Other opinions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 07:53:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29290#M14964</guid>
      <dc:creator>tombaeyens</dc:creator>
      <dc:date>2011-04-05T07:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a context classloader when calling client code</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29291#M14965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Tom.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We already have a custom classloader configurable in Activiti. Setting it correctly as context classloader is vital, otherwise that is a half baked solution. And it is exactly like it is done in every app server and like it was done in jBPM 3 as well. Without this, it is not really usable in enterprise environments or scoped deployments. Having your own delegate is only half of the solution: This delegate must be loaded by some classloader as well and when using expressions or the like, you don't even have that opportunity. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I think we have to do that change. And I don't see anything it could break. Setting your own classloader (with the original class loader as parent) as context classloader is normal behavior and intended by the Java Platform. I don't see any risks with that, but if you have references pointing to such problems it would be interesting to see…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bernd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 08:07:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29291#M14965</guid>
      <dc:creator>bernd_ruecker</dc:creator>
      <dc:date>2011-04-05T08:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a context classloader when calling client code</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29292#M14966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you explain a bit the use case you're implementing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it classloading from process archives in an ejb environment like you did in jbpm4?&amp;nbsp; If this is the case, are all the pieces in the Activiti code base?&amp;nbsp;&amp;nbsp; Or is this use case something else?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 08:52:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29292#M14966</guid>
      <dc:creator>tombaeyens</dc:creator>
      <dc:date>2011-04-05T08:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a context classloader when calling client code</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29293#M14967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Basically yes, it is a deployer infrastructure, in this case for JBoss 5.1. No, that is not part of the Activiti code base, since such a deployer infrastructure depends heavily on the specific server (and version). We only committed CDI (which is Java EE 6 standard) to the Activiti code base. But the custom class loader is part of Activiti core, as you may know &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 10:07:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29293#M14967</guid>
      <dc:creator>bernd_ruecker</dc:creator>
      <dc:date>2011-04-05T10:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a context classloader when calling client code</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29294#M14968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Soon, we'll be working out a classloading scheme incl deployments that also works on the cloud.&amp;nbsp; Still to be determined how that is going to look like.&amp;nbsp; So I think we should postpone this issue until that time.&amp;nbsp; Ideas like deploying a jar engine-wide through our deploy mechanism is what we're thinking about.&amp;nbsp; I want those ideas to settle so that we can create an implementation based on the target use cases first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also impact of OSGi classloading is still unclear to me.&amp;nbsp; Maybe we should assemble all classloading related information into a wiki page so that we can capture all ideas and work towards a simple scheme that works for everyone.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 12:04:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29294#M14968</guid>
      <dc:creator>tombaeyens</dc:creator>
      <dc:date>2011-04-05T12:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a context classloader when calling client code</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29295#M14969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Tom,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand your concerns. Just out of curiosity, what exactly do you mean by "cloud"? Sth. like this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://aws.amazon.com/elasticbeanstalk/" rel="nofollow noopener noreferrer"&gt;http://aws.amazon.com/elasticbeanstalk/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you suggested: &lt;/SPAN&gt;&lt;A href="http://docs.codehaus.org/display/ACT/Activiti+Classloading" rel="nofollow noopener noreferrer"&gt;http://docs.codehaus.org/display/ACT/Activiti+Classloading&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 07:46:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-a-context-classloader-when-calling-client-code/m-p/29295#M14969</guid>
      <dc:creator>meyerd</dc:creator>
      <dc:date>2011-04-08T07:46:51Z</dc:date>
    </item>
  </channel>
</rss>

