5 Replies Latest reply on May 22, 2008 11:33 PM by smscentral

    error loading module using ModuleManager

    smscentral
      Hi all,

      I load a module using ModuleManager.getModule(modname) in a flex application.
      module is loaded successfully.

      and when i try to click the links in the module,it connects to HTTPService and gets the data successfully but before showing data i get the following error:
      #1009: Cannot access a property or method of a null object reference.

      i try to debug and i see this in debug mode

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.rpc::AbstractInvoker$cinit()
      at global$init()
      at global$init()
      at mitto.core::MittoBackendRequest()
      at mitto.core::MittoBackendRequest$/CreateBackendRequest()
      at component.MXML::ListUsersComponent/entitiesList()
      at UserModule/linkToListUsers()
      at UserModule/__listUsers_click()

      what is this at mx.rpc::AbstractInvoker$cinit()
      at global$init()
      at global$init() ??/

      when i click continue when the error pops up, i get back to the list with my data in datagrid.

      Any suggestion would be helpful.

      Thanks

        • 1. Re: error loading module using ModuleManager
          atta707 Level 2
          can you show some working code that shows the problem?
          • 2. Re: error loading module using ModuleManager
            smscentral Level 1
            thanks for ur time.

            i am loading the module using module manager

            public function loadModule(filePath:String):void {
            mittoAppInstance = MittoApp.getInstance();
            moduleInfo = ModuleManager.getModule(filePath);
            moduleInfo.addEventListener(ModuleEvent.READY, modReadyEventHandler);
            moduleInfo.addEventListener(ModuleEvent.PROGRESS,modProgressEventHandler);
            moduleInfo.addEventListener(ModuleEvent.ERROR, modErrorEventHandler);
            moduleInfo.load();
            MittoApp.getInstance().progressbar.visible = true;
            }

            //get the instance of module , call method on that object, add it to the main application
            private function modReadyEventHandler(e:ModuleEvent):void {
            moduleInstance = this.getModuleInstance();
            this.addToApplication();
            }

            //get the instance of the module
            public function getModuleInstance():Object{
            return moduleInfo.factory.create() as Object;
            }

            //add module to mitto application
            public function addToApplication():void{
            mittoAppInstance.main.addChild(moduleInstance as DisplayObject);
            }


            and my module has some links
            <mx:ControlBar>
            <mx:LinkButton id="addUser" label="Add User" click="linkToAddUser();"/>
            <mx:LinkButton id="listUsers" label="List Users" click="linkToListUsers();"/>
            <mx:LinkButton id="editpermissions" label="Edit Permission" click="selectUser()"/>
            </mx:ControlBar>

            public function linkToListUsers():void{
            listUsersInstance = new ListUsersComponent()
            listUsersInstance.list_url="usermanagement";
            listUsersInstance.action="listusers";
            listUsersInstance.entitiesList();
            this.remove();
            usermain.addChild(listUsersInstance);
            }

            and as i click on list users..i get the exception 1009.

            Thanks

            • 3. Re: error loading module using ModuleManager
              atta707 Level 2
              So far so good! The exception source is actually going beyond this code: in the MittoBackendRequest.CreateBackendRequest() method.

              have tried to debug this method?
              • 4. error loading module using ModuleManager
                smscentral Level 1
                thanks
                renderer code attached
                • 5. Re: error loading module using ModuleManager
                  smscentral Level 1
                  hi...

                  i try to debug that mittobackendrequest but as and when i click my link..it shows up the error..

                  at mx.rpc::AbstractInvoker$cinit()
                  at global$init()
                  at global$init()
                  at mitto.core::MittoBackendRequest()
                  at mitto.core::MittoBackendRequest$/CreateBackendRequest()
                  at component.MXML::ListUsersComponent/entitiesList()
                  at UserModule/linkToListUsers()
                  at UserModule/__listUsers_click()


                  mittobackend request class :