<?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: Accessing jndi in activiti in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/accessing-jndi-in-activiti/m-p/148877#M103908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The API-calls you trigger, run inside the thread you call them from. Any resources specific to the environment are available (eg lookup in JNDI). The job-executor, on the other hand, executes job in a single thread that is part if an internal thread-pool. These threads don't run in the same context as the API-calls you do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to extends the JobExecutor and, prior to actually executing a job, make sure the thread has access to the resources it needs. not sure how you set this up for your usecase. Anyway, some piece of code (prolly in the framework you're using) makes sure JNDI-calls are possible from the threads. If you're not using anything special, It might be that the container-thread handling the request (eg. tomcat) makes sure the treads have access to the JNDI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To make a long story short: Extend JobExecutor and override the right class (perhaps even ExecuteJobCmd) to wrap the running of the job with your environment initialisation. Does that make sense?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Dec 2013 12:29:51 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2013-12-10T12:29:51Z</dc:date>
    <item>
      <title>Accessing jndi in activiti</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-jndi-in-activiti/m-p/148876#M103907</link>
      <description>I have a problem when accessing jndi in activiti. I have read the articles : http://forums.activiti.org/content/persistence and http://forums.activiti.org/content/jdbc-datasource-out-jndi but still no success. We use hibernate with the jpa specification for our project. I'm able to execute hibernate</description>
      <pubDate>Mon, 09 Dec 2013 05:33:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-jndi-in-activiti/m-p/148876#M103907</guid>
      <dc:creator>chilopoda</dc:creator>
      <dc:date>2013-12-09T05:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing jndi in activiti</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-jndi-in-activiti/m-p/148877#M103908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The API-calls you trigger, run inside the thread you call them from. Any resources specific to the environment are available (eg lookup in JNDI). The job-executor, on the other hand, executes job in a single thread that is part if an internal thread-pool. These threads don't run in the same context as the API-calls you do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to extends the JobExecutor and, prior to actually executing a job, make sure the thread has access to the resources it needs. not sure how you set this up for your usecase. Anyway, some piece of code (prolly in the framework you're using) makes sure JNDI-calls are possible from the threads. If you're not using anything special, It might be that the container-thread handling the request (eg. tomcat) makes sure the treads have access to the JNDI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To make a long story short: Extend JobExecutor and override the right class (perhaps even ExecuteJobCmd) to wrap the running of the job with your environment initialisation. Does that make sense?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 12:29:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-jndi-in-activiti/m-p/148877#M103908</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-12-10T12:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing jndi in activiti</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-jndi-in-activiti/m-p/148878#M103909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, frederikheremans, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the quick response. The statement above makes sense especially: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockquote&amp;gt;The job-executor, on the other hand, executes job in a single thread that is part if an internal thread-pool. These threads don't run in the same context as the API-calls you do.&amp;lt;/blockquote&amp;gt; I think my problem is about the context, i.e when there is a trigger from the jobexecutor, I loose the context and therefore not able to access the JNDI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As for your suggestion, &amp;lt;blockquote&amp;gt;You need to extends the JobExecutor and, prior to actually executing a job, make sure the thread has access to the resources it needs. not sure how you set this up for your usecase.&amp;lt;/blockquote&amp;gt; I think this must be the solution but the problem I do not know how to exactly implement this. I'm still new in java but very much interested and always willing to try new stuff. I just can't figure out why if i just use a service task or tasklistener without the triggers I'm able to execute any queries but if i call say a service task as a result of a trigger, i just get an error and cant access the JNDI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please give me step by step guideline? alternatively, i can also attach any files you may need for further clarification.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For our environment we use JbossAS 7 and stripes framework. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 05:39:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-jndi-in-activiti/m-p/148878#M103909</guid>
      <dc:creator>chilopoda</dc:creator>
      <dc:date>2013-12-11T05:39:06Z</dc:date>
    </item>
  </channel>
</rss>

