Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: The modules with proxies have error when load both  (Read 6441 times)
marks416
Sr. Member
****
Posts: 52


View Profile Email
« on: February 27, 2009, 12:28:20 »

Hi Darshan,

I have two fabrication database applications that have proxies and delegations,  they work fine independently,

I covert them to two modules as FlexModule(moduleA and moduleB)

I use shell load two modules(moduleA and moduleB). it works fine if I load just one of them(moduleA or moduleB). the functions in each module works.


The errors happen when I run any function in any module if I load both module (moduleA and moduleB) with shell.

I use your SimpleModule as an test module(moduleC). each of test module(moduleA and moduleB) works file with moduleC.

This is the summary:

moduleA works fine if shell only load moduleA.
moduleB works fine if shell only load moduleB.
moduleA works fine if shell load moduleA and moduleC.
moduleB works fine if shell load moduleB and moduleC.

moduleA or moduleB doesn't work  if shell load moduleA and moduleB.

It seem the database Modules (moduleA and moduleB) can not work when both are loaded.they affect each other

Please let me know how to fix the problem.

Thanks


Mark

ps: error message:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.messaging.messages::AcknowledgeMessageExt@4ffc139 to mx.messaging.messages.IMessage.
TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::HistoryManagerImpl@ef18089 to mx.managers.IHistoryManager.
   at mx.managers::HistoryManager$/get impl()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\HistoryManager.as:96]
   at mx.managers::HistoryManager$/unregister()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\managers\HistoryManager.as:144]
   at mx.containers::Accordion/removedFromStageHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\containers\Accordion.as:2160]
   at flash.display::DisplayObjectContainer/removeChild()
   at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$removeChild()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5074]
   at mx.core::Container/removeChild()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\Container.as:2267]
   at shell.view::ModulesContainerMediator/unloadModule()[D:\WORKSPACE\Flex Builder 3\FabricationRounting\src\shell\view\ModulesContainerMediator.as:110]
   at shell.view::ModulesContainerMediator/respondToRemovedFromList()[D:\WORKSPACE\Flex Builder 3\FabricationRounting\src\shell\view\ModulesContainerMediator.as:81]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.mediator::FabricationMediator/invokeNotificationHandler()[D:\Projects\sawardekar\fabrication\googlecode\framework\trunk\src\main\as3\org\puremvc\as3\multicore\utilities\fabrication\patterns\mediator\FabricationMediator.as:579]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.mediator::FabricationMediator/handleNotification()[D:\Projects\sawardekar\fabrication\googlecode\framework\trunk\src\main\as3\org\puremvc\as3\multicore\utilities\fabrication\patterns\mediator\FabricationMediator.as:384]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
   at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationView/notifyObservers()[D:\Projects\sawardekar\fabrication\googlecode\framework\trunk\src\main\as3\org\puremvc\as3\multicore\utilities\fabrication\core\FabricationView.as:77]
   at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
   at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
   at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:60]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.proxy::FabricationProxy/sendNotification()[D:\Projects\sawardekar\fabrication\googlecode\framework\trunk\src\main\as3\org\puremvc\as3\multicore\utilities\fabrication\patterns\proxy\FabricationProxy.as:161]
   at shell.model::ListProxy/remove()[D:\WORKSPACE\Flex Builder 3\FabricationRounting\src\shell\model\ListProxy.as:34]
   at shell.model::ListProxy/removeAll()[D:\WORKSPACE\Flex Builder 3\FabricationRounting\src\shell\model\ListProxy.as:40]
   at shell.controller::RemoveAllModulesCommand/execute()[D:\WORKSPACE\Flex Builder 3\FabricationRounting\src\shell\controller\RemoveAllModulesCommand.as:14]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationController/executeCommand()[D:\Projects\sawardekar\fabrication\googlecode\framework\trunk\src\main\as3\org\puremvc\as3\multicore\utilities\fabrication\core\FabricationController.as:164]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
   at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationView/notifyObservers()[D:\Projects\sawardekar\fabrication\googlecode\framework\trunk\src\main\as3\org\puremvc\as3\multicore\utilities\fabrication\core\FabricationView.as:77]
   at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
   at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
   at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:60]
   at shell.view::MessageControlBarMediator/removeAllButtonListener()[D:\WORKSPACE\Flex Builder 3\FabricationRounting\src\shell\view\MessageControlBarMediator.as:179]

Logged
Darshan Sawardekar
Sr. Member
****
Posts: 85


View Profile Email
« Reply #1 on: March 01, 2009, 12:20:54 »

Hey Mark,

This looks like an issue with incompatible Flex sdks. I suggest recompiling the shell, and all modules with the same sdk. That might help.

peace,
darshan
Logged
marks416
Sr. Member
****
Posts: 52


View Profile Email
« Reply #2 on: March 02, 2009, 09:18:52 »

Hi Darshan,

I use the same version SDK for the modules and shell.

any other possibility to fix the problem. Please help


Thanks

Mark
Logged
papiot
Newbie
*
Posts: 4


View Profile Email
« Reply #3 on: March 05, 2009, 01:44:05 »

Hi Darshan,

I am working with Mark on the same project.  We cannot seem to find a solution for our problem.  Just by intuition, I have a feeling we are not doing something right when trying to add our own modules to the shell demo.

First, let me describe what we are doing.

The goal
- We have two stand-alone applications (ModuleA and ModuleB) which are built using PureMVC multicore and we are trying to integrate them into a shell.
- For now, all we want is to have both of our apps to be loaded into the shell, and work on their own (no module-to-module communication, or module-to-shell comunication)

We took the shell routing demo, and inside the src folder, we noticed you have:
- shell
- simplemodule

Following the example, we took the code for both ModuleA and ModuleB and placed it in the shell app, so now we have:

- shell
- simplemodule
- ModuleA
- ModuleB
-(other folders)

For each of ModuleA and ModuleB, we have taken the main MXML file, and turned it into a fab:FlexModule.

We have modified the demo, so instead of only one "Add Module"  button, now there are 2.

The whole project has only 1 lib folder, in which we have all the libraries needed for all the modules.

We then compile the whole project (the shell), and we end up with 4 binaries - shell.swf, simplemodule.swf, moduleA.swf and moduleB.swf.

This is what happens when we run the Shell:

- When we load only one module (doesn't matter which one), it gets loaded and it works fine.  We can even load the same module multiple times and it still works fine - each instance being independent of the other one.

- IF we load one of our modules (either A or B) and then we also load the simplemodule.swf, our module still works fine.

We start getting into trouble if we load BOTH of our modules (Module A and Module B).  We get different errors, but they are all of the same type.  I will post a few of them at the end of the thread.

Are we doing anything wrong in terms of our methodology of trying to get our modules into the shell?

Any help appreciated.

Thanks,

Catalin

Some errors:

This error appears when clicking on the "remove all" button that's part of the demo.
TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::HistoryManagerImpl@bfb5291 to mx.managers.IHistoryManager

This error appears when loading Module A, playing around with it, then loading Module B, then going back to Module A and playing around again
TypeError: Error #1034: Type Coercion failed: cannot convert mx.messaging.messages::AcknowledgeMessageExt@4fd8ef9 to mx.messaging.messages.IMessage

Logged
papiot
Newbie
*
Posts: 4


View Profile Email
« Reply #4 on: March 09, 2009, 09:19:15 »

I am not sure who is still watching this thread, but I have finally fixed my issues.

The good news is they have nothing to do with Fabrication, PureMVC or the way I was loading my modules.

The bad news is that the issues are actually a bug in Flex/AS3.  Without going into details, to fix the problem I had to add these lines of code in the main mxml file for the fabrication routing demo:

import mx.messaging.messages.AcknowledgeMessageExt;
import mx.managers.HistoryManager;
private var hist:HistoryManager;
private var ak:AcknowledgeMessageExt;


I am not using the 2 variables anywhere in my project, but for some reason I HAVE to declare them in the main shell, otherwise flex gets confused and craps out.  Here are some links that further explain this issue:

http://www.blogjava.net/fine/archive/2009/01/04/249753.html
https://bugs.adobe.com/jira/browse/SDK-13121
http://bugs.adobe.com/jira/browse/SDK-12218

Thanks, and I hope this will save many hours to someone else if they are encountering this issue/issues :)
Logged
Pages: [1]
Print