0 Replies Latest reply on Jan 24, 2007 1:06 PM by awclemen

    Error #1009 when loading a module

      Hello Forum Folks,

      I'm in the process of trying to upgrade our app from 2.0 to 2.0.1. In this application we have an SWFLoader that loads up applications as requested by the user. It worked fine with no problems. I'm attempting to use the ModuleLoader in the same way, but I am receiving this error:

      [SWF] /flex/PMPortal/com/sundt/addressbook/company_find_app.swf - 855,412 bytes after decompression
      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.managers::HistoryManager$/register()
      at mx.containers::ViewStack/::addedHandler()
      at flash.display::DisplayObjectContainer/addChildAt()
      at mx.core::UIComponent/ http://www.adobe.com/2006/flex/mx/internal::$addChildAt()[C:\dev\flex_201_gmc\sdk\framewor ks\mx\core\UIComponent.as:4676
      at mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 278]
      at mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
      at mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
      at mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
      at mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
      at mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
      at mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
      at com.sundt.addressbook::find_company_criteria/initialize()
      at mx.core::UIComponent/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
      at mx.core::Container/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
      at mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
      at mx.containers::Form/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\containers\Form.as :179]
      at mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
      at mx.containers::Form/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\containers\Form.as:1 68]
      at mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
      at mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
      at mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
      at mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
      at mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
      at mx.core::UIComponent/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
      at mx.core::Container/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
      at mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
      at mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
      at mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
      at mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
      at mx.containers::Panel/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks \mx\containers\Panel.as:1308]
      at mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
      at mx.containers::Panel/mx.containers:Panel::createChildren()[C:\dev\flex_201_gmc\sdk\framew orks\mx\containers\Panel.as:863]
      at mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
      at mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
      at mx.core::UIComponent/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
      at mx.core::Container/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
      at mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
      at mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
      at mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
      at mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
      at mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
      at mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
      at mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
      at mx.core::UIComponent/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
      at mx.core::Container/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
      at mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
      at mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
      at mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
      at mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
      at mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
      at mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
      at mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
      at com.sundt.addressbook::company_find_app/initialize()
      at mx.core::UIComponent/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
      at mx.core::Container/ http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
      at mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
      at mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
      at mx.modules::ModuleLoader/mx.modules:ModuleLoader::moduleReadyHandler()[C:\dev\flex_201_gm c\sdk\frameworks\mx\modules\ModuleLoader.as:339]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at ModuleManager.as$117::ModuleInfoProxy/ModuleManager.as$117:ModuleInfoProxy::moduleEventHa ndler()[C:\dev\flex_201_gmc\sdk\frameworks\mx\modules\ModuleManager.as:1025]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at ModuleManager.as$117::ModuleInfo/readyHandler()[C:\dev\flex_201_gmc\sdk\frameworks\mx\mod ules\ModuleManager.as:704]

      I'm not sure what is null, as I don't have the source code for the HistoryManager. It seems to be generating an error while attempting to initialize a component that is part of the module that it is currently loading. The strange part about this is that I can load the module a once and then it will error, as show below:

      [SWF] /flex/PMPortal/pmportal-debug.swf - 1,033,911 bytes after decompression
      [SWF] /flex/PMPortal/com/sundt/addressbook/company_find_app.swf - 855,412 bytes after decompression
      [SWF] /flex/PMPortal/blank_app.swf - 484,084 bytes after decompression
      [SWF] /flex/PMPortal/blank_app.swf - 484,084 bytes after decompression
      [SWF] /flex/PMPortal/com/sundt/addressbook/contact_find_app.swf - 678,199 bytes after decompression
      [SWF] /flex/PMPortal/com/sundt/addressbook/personalCompanies/personal_companies_wizard_app.swf - 809,691 bytes after decompression
      [SWF] /flex/PMPortal/com/sundt/addressbook/company_find_app.swf - 855,412 bytes after decompression
      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.managers::HistoryManager$/register()

      There are also times that it will error on loading another module just once.

      Now, I am loading all my modules through the same ModuleLoader without unloading them. I assume that this is correct way to do this.

      If I comment out the offending component, everything works fine. The components worked fine before when I had them in applications.

      Not sure where to go from here... any ideas would be great.

      Thanks in advance.

      --Andy