<?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 Autowiring does not work with org.activiti.engine.test.ActivitiRule in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/autowiring-does-not-work-with-org-activiti-engine-test/m-p/125748#M88491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We had an issue with our spring beans not being autowired in our unit tests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Our activiti.cfg.xml file contains&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;context:annotation-config/&amp;gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;We call a JavaDelegate class using activiti:delegateExpression&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt; &amp;lt;serviceTask id="checkValidName" name="CheckValidName" activiti:delegateExpression="${nameChecker}"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;SPAN class="line-numbers-rows"&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;The cause of the problem is ActivitiRule who delegates to org.activiti.engine.impl.cfg.BeansConfigurationHelper:&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;arseProcessEngineConfiguration to instantiate the spring context using DefaultListableBeanFactory. Because no ApplicationContext is used, the &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;context:annotation-config/&amp;gt; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;seems to be ignored. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(BeanFactory only supports the older Autowire collaborators mechanism. &lt;/SPAN&gt;&lt;A href="http://static.springsource.org/spring/docs/3.0.0.RELEASE/reference/htmlsingle/#beans-factory-autowire" rel="nofollow noopener noreferrer"&gt;http://static.springsource.org/spring/docs/3.0.0.RELEASE/reference/htmlsingle/#beans-factory-autowire&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If we instantiate the Spring context ourselves in the unit test using ClassPathXmlApplicationContext, we have no issues with autowiring.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to review the implementation of BeansConfigurationHelper to use an application context instead of beanFactory?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jul 2013 09:54:55 GMT</pubDate>
    <dc:creator>wsalembi</dc:creator>
    <dc:date>2013-07-17T09:54:55Z</dc:date>
    <item>
      <title>Autowiring does not work with org.activiti.engine.test.ActivitiRule</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/autowiring-does-not-work-with-org-activiti-engine-test/m-p/125748#M88491</link>
      <description>We had an issue with our spring beans not being autowired in our unit tests.Our activiti.cfg.xml file contains&amp;nbsp; &amp;lt;context:annotation-config/&amp;gt;‍We call a JavaDelegate class using activiti:delegateExpression&amp;nbsp;&amp;nbsp;  &amp;lt;serviceTask id="checkValidName" name="CheckValidName" activiti:delegateExpression="</description>
      <pubDate>Wed, 17 Jul 2013 09:54:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/autowiring-does-not-work-with-org-activiti-engine-test/m-p/125748#M88491</guid>
      <dc:creator>wsalembi</dc:creator>
      <dc:date>2013-07-17T09:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Autowiring does not work with org.activiti.engine.test.ActivitiRule</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/autowiring-does-not-work-with-org-activiti-engine-test/m-p/125749#M88492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://forums.activiti.org/content/problem-spring-autowiring-within-service-task#comment-18399" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/problem-spring-autowiring-within-service-task#comment-18399&lt;/A&gt;&lt;SPAN&gt; for more discussion on this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 12:46:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/autowiring-does-not-work-with-org-activiti-engine-test/m-p/125749#M88492</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-07-17T12:46:53Z</dc:date>
    </item>
  </channel>
</rss>

