<?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 Activiti initializes engine twice under WebLogic in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-initializes-engine-twice-under-weblogic/m-p/101712#M70667</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to run Activiti as a library in our application on WebLogic. What I observe is that Activiti finds the (single) configuration twice and initializes the engine twice. Here is an excerpt from the start log:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;INFO | 2012-06-22 08:19:30.182 | workflow.engine.WfEngineManager | startEngine&lt;BR /&gt;Looking for workflow engines to start…&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:30.189 | org.activiti.engine.ProcessEngines | initProcessEnginFromResource&lt;BR /&gt;initializing process engine for resource &lt;STRONG style="color: #FF0000;"&gt;zip:/home/weblogic1035/user_projects/domains/mydomain/servers/AdminServer/tmp/_WL_user/workflow/tizqbw/workflow.jar!/activiti.cfg.xml&lt;/STRONG&gt;&lt;BR /&gt;- Loading XML bean definitions from resource loaded through InputStream&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:31.519 | org.activiti.engine.impl.ProcessEngineImpl | &amp;lt;init&amp;gt;&lt;BR /&gt;ProcessEngine &lt;STRONG&gt;myWFengine&lt;/STRONG&gt; created&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:31.519 | org.activiti.engine.impl.jobexecutor.JobExecutor | start&lt;BR /&gt;Starting up the JobExecutor[org.activiti.engine.impl.jobexecutor.DefaultJobExecutor].&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:31.523 | org.activiti.engine.ProcessEngines | initProcessEnginFromResource&lt;BR /&gt;initialised process engine myWFengine&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:31.527 | org.activiti.engine.impl.jobexecutor.AcquireJobsRunnable | run&lt;BR /&gt;JobExecutor[org.activiti.engine.impl.jobexecutor.DefaultJobExecutor] starting to acquire jobs&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:31.527 | org.activiti.engine.ProcessEngines | initProcessEnginFromResource&lt;BR /&gt;initializing process engine for resource &lt;STRONG style="color: #FF0000;"&gt;zip:/home/weblogic1035/user_projects/domains/mydomain/servers/AdminServer/tmp/_WL_user/workflow/tizqbw/workflow.jar!/activiti.cfg.xml&lt;/STRONG&gt;&lt;BR /&gt;- Loading XML bean definitions from resource loaded through InputStream&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:33.413 | org.activiti.engine.impl.ProcessEngineImpl | &amp;lt;init&amp;gt;&lt;BR /&gt;ProcessEngine &lt;STRONG&gt;myWFengine&lt;/STRONG&gt; created&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:33.413 | org.activiti.engine.impl.jobexecutor.JobExecutor | start&lt;BR /&gt;Starting up the JobExecutor[org.activiti.engine.impl.jobexecutor.DefaultJobExecutor].&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:33.413 | org.activiti.engine.ProcessEngines | initProcessEnginFromResource&lt;BR /&gt;initialised process engine myWFengine&lt;BR /&gt;&lt;BR /&gt;INFO | 2012-06-22 08:19:33.414 | workflow.engine.WfEngineManager | startEngine&lt;BR /&gt;The available 1 workflow engines have been started.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;(Please note the duplication of the resource URL)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To remove the redundant initializations I propose in the init() method of ProcessEngines class to replace&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (resources.hasMoreElements()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; URL resource = resources.nextElement();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initProcessEnginFromResource(resource);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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;SPAN&gt;with&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Remove duplicated configuration URLs&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set&amp;lt;URL&amp;gt; configUrls = new HashSet&amp;lt;URL&amp;gt;();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (resources.hasMoreElements()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configUrls.add( resources.nextElement() );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Init engines&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (Iterator&amp;lt;URL&amp;gt; iterator = configUrls.iterator(); iterator.hasNext();) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; URL resource = iterator.next();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initProcessEnginFromResource(resource);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2012 08:24:45 GMT</pubDate>
    <dc:creator>mmaker1234</dc:creator>
    <dc:date>2012-06-22T08:24:45Z</dc:date>
    <item>
      <title>Activiti initializes engine twice under WebLogic</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-initializes-engine-twice-under-weblogic/m-p/101712#M70667</link>
      <description>Hello,I tried to run Activiti as a library in our application on WebLogic. What I observe is that Activiti finds the (single) configuration twice and initializes the engine twice. Here is an excerpt from the start log:INFO | 2012-06-22 08:19:30.182 | workflow.engine.WfEngineManager | startEngineLook</description>
      <pubDate>Fri, 22 Jun 2012 08:24:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-initializes-engine-twice-under-weblogic/m-p/101712#M70667</guid>
      <dc:creator>mmaker1234</dc:creator>
      <dc:date>2012-06-22T08:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti initializes engine twice under WebLogic</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-initializes-engine-twice-under-weblogic/m-p/101713#M70668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Seems like a valid improvement. I'll add this to trunk. To prevent this issue for now, maybe best to initialize the engine yourself, based on the configuration-file URL rather that just use the "default" initialization.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 08:30:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-initializes-engine-twice-under-weblogic/m-p/101713#M70668</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2012-06-22T08:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti initializes engine twice under WebLogic</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-initializes-engine-twice-under-weblogic/m-p/101714#M70669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Frederik,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your quick reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We also thought on the approach to provide a configuration URL but here are our concerns:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - We prefer to non burden our administrators with file placements and application configuration tasks;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - Our application is deployed in different directories on the different servers (dev, test, prod, …)&amp;nbsp; because some of them share the same file/operating system;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - WebLogic (as you can see in the provided log excerpt) unpacks the application .EAR(s) in different temporary directories.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As a consequence:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - It is not easy to "invent" an URL that to be valid on all environments where our application works &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - We decided to deliver the Activiti configuration with our .EARs and to use the "default" initialization;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The original post was not a complaint (in contrast to &lt;/SPAN&gt;&lt;A href="http://forums.activiti.org/en/viewtopic.php?f=6&amp;amp;t=4121&amp;amp;p=16036" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/en/viewtopic.php?f=6&amp;amp;t=4121&amp;amp;p=16036&lt;/A&gt;&lt;SPAN&gt; where I still expect an answer) - I only shared our experience. Actually the duplicated WF engine initialization is not a big issue for us:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - The first engine is stopped during the second initialization because the engine names appear to be equal;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - The initialization is fast enough (a couple of seconds, as you can see in the logs);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - As a result we have only one engine, which is the desired behavior;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - I already patched Activiti 5.9 and built it for our environment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 10:59:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-initializes-engine-twice-under-weblogic/m-p/101714#M70669</guid>
      <dc:creator>mmaker1234</dc:creator>
      <dc:date>2012-06-22T10:59:50Z</dc:date>
    </item>
  </channel>
</rss>

