2 Replies Latest reply on Aug 25, 2011 11:21 AM by ilya_k

    AutomationManager$/createDelegate() failed with NPE

    ilya_k Level 1

      Greetings!

       

      Could not find a thread correspondent to the Flex automation framework, so will start new...

       

      I am using Flex 3.3 SDK. Platform is Windows XP. Flex automation libraries are taken from Flex Builder 3.2 PRO and

      statically linked into main application.

       

      1. Main application "main" loads trusted sub-application "subapp" in the child application domain.

      2. subapp does not link with automation libraries (documentation is not clear on that but I have

          tried both way  - with and without)

      3. main communicates with subapp like this:

       

      var contentLoader:SWFLoader  = new SWFLoader();

      ....

      Then main listens FlexEvent.APPLICATION_COMPLETE event and in the event handler does:

       

      var sccLoadable:ISCCLoadable = (contentLoader.content as SystemManager).application as ISCCLoadable;

       

      sccLoadable is the reference to subap instance, so we can access to subapp's public methods and properties.

       

      4. Next, main calls var embeddedComponent:Canvas = subapp.getDialog() method. The method returns visual

      component extended from Canvas. Nothing fancy. Note, embeddedComponent extends Canvas and

      such, according to doc, custom delegate is not required.

       

      5. Then main instantiates TitleWindow titleWindow and invokes titleWondow.addChild( embeddedComponent );

       

      6. Next, main invokes

      PopUpManager.addPopUp( titleWindows as IFlexDisplayObject, DisplayObject(parentOfTttleWinodw), true, PopUpManagerChildList.PARENT );

       

      I am getting error (sorry for the spam):

       

      Error: Error #1009: Cannot access a property or method of a null object reference.

      at mx.automation::AutomationManager$/createDelegate()[C:\work\flex\dmv_automation\projects\a utomation\src\mx\automation\AutomationManager.as:290]

      at mx.automation::AutomationManager$/childAddedHandler()[C:\work\flex\dmv_automation\project s\automation\src\mx\automation\AutomationManager.as:205]

      at flash.display::DisplayObjectContainer/addChildAt()

      at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$addChildAt()

      at mx.core::Container/addChildAt()

      at mx.core::Container/addChild()

      at com.sybase.scc.utils::SubappLoader/onAppConstructed()[C:\project\scc32\scc322_ilyak_ccrc\ calm\dub\uafdev\scc\app\flex_src\com\sybase\scc\utils\SubappLoader.as:410]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.managers::SystemManager/preloader_preloaderDoneHandler()[C:\autobuild\3.3.0\frameworks \projects\framework\src\mx\managers\SystemManager.as:3025]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.preloaders::Preloader/displayClassCompleteHandler()[C:\autobuild\3.3.0\frameworks\proj ects\framework\src\mx\preloaders\Preloader.as:434]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.preloaders::DownloadProgressBar/timerHandler()[C:\autobuild\3.3.0\frameworks\projects\ framework\src\mx\preloaders\DownloadProgressBar.as:1451]

      at mx.preloaders::DownloadProgressBar/initCompleteHandler()[C:\autobuild\3.3.0\frameworks\pr ojects\framework\src\mx\preloaders\DownloadProgressBar.as:1503]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.preloaders::Preloader/dispatchAppEndEvent()[C:\autobuild\3.3.0\frameworks\projects\fra mework\src\mx\preloaders\Preloader.as:291]

      at mx.preloaders::Preloader/appCreationCompleteHandler()[C:\autobuild\3.3.0\frameworks\proje cts\framework\src\mx\preloaders\Preloader.as:442]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.core::UIComponent/dispatchEvent()

      at mx.core::UIComponent/set initialized()

      at mx.managers::LayoutManager/doPhasedInstantiation()

      at Function/http://adobe.com/AS3/2006/builtin::apply()

      at mx.core::UIComponent/callLaterDispatcher2()

      at mx.core::UIComponent/callLaterDispatcher()

       

      I am getting same error in  same place if I use not PopUp but container and run addChild( embeddedComponent ) instead.

       

      More on that.

      7. Everything runs as expected without automation libraries.

      8. If I convert subapp to action script classes and instead of loading subapp do new Subapp() everything works.

      9. If I load subapp in the current application domain not in the child application domain everything works as well.

       

      Unfortunately due to nature of our application neither 8 or 9 workarounds acceptable.

       

      There are a lot of good people here with deep Flex knowlage and I am wondering if someone can help me with the issue.

       

      Thanks.