Uploaded image for project: 'SX Spring Actionscript'
  1. SX Spring Actionscript

Object requires dependency getter for dependency satisfaction test


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: IoC container
    • Labels:
    • Environment:
      SpringAS 2.0.1


      Assuming this is my config:

      <object id="myObject" class="com.test.MyObject">
      <property name="objectProperty">
      <dictionary id="securityMapping">

      public class MyObject implements IInitializingObject {
      private var _objectProperty:Dictionary;

      public function set objectProperty(value:Dictionary):void

      { _objectProperty = value; }

      public function afterPropertiesSet():void

      { ... }


      In this case the afterPropertiesSet isn't called because according to SpringAS2 the objectProperty dependency hasn't been satisfied yet, so it skips DefaultDependencyInjector.initializeInstance(). More specifically because of this block of code in DefaultDependencyChecker.checkDependenciesSatisfied():

      var isNull:Boolean = true;
      try {
      if (!property.isStatic)

      { isNull = (instance[property.qName] == null); }


      { isNull = ((objectDefinition.clazz)[property.qName] == null); }

      } catch (e:Error) {

      because the field isn't static, it will try to access the property, but since it only has a setter it will return null. I've debugged the code and the objectProperty property has been injected, so it is not null.
      This was working in SpringAS1.

      I've attached a testcase with a unit test which tests this behavior. One test fails because the afterPropertiesSet hasn't been called by the context after initialization.
      You can execute the testcase by calling the "gradlew test" command in the root folder. Also make sure that you've set the FLEX_HOME environment variable to the location of your 4.x Flex SDK.


        There are no comments yet on this issue.


          • Assignee:
            cherreman Christophe Herreman
            slevinbe Yennick Trevels
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: