ReferenceError: Error #1065: Variable IInjector is not defined.
Hi, all;
I created an application that uses Robotlegs, and for various reasons, at the last minute we need to change it from being a Spark Application to being a Module. The issue that I am having is, at startup, I get
ReferenceError: Error #1065: Variable IInjector is not defined.
at flash.system::ApplicationDomain/getDefinition()
at org.swiftsuspenders.injectionpoints::PropertyInjectionPoint/initializeInjection()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/injectionpoints/PropertyInjectionPoint.as:58]
at org.swiftsuspenders.injectionpoints::InjectionPoint()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/injectionpoints/InjectionPoint.as:19]
at org.swiftsuspenders.injectionpoints::PropertyInjectionPoint()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/injectionpoints/PropertyInjectionPoint.as:31]
at org.swiftsuspenders::Injector/getInjectionPoints()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/Injector.as:271]
at org.swiftsuspenders::Injector/instantiate()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/Injector.as:130]
at org.robotlegs.base::CommandMap/execute()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/base/CommandMap.as:168]
at org.robotlegs.base::CommandMap/routeEventToCommand()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/base/CommandMap.as:223]
at Function/<anonymous>()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/base/CommandMap.as:98]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at org.robotlegs.base::ContextBase/dispatchEvent()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/base/ContextBase.as:70]
at org.robotlegs.mvcs::Context/startup()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/mvcs/Context.as:104]
at runtime.context::UniversalContext/startup()[/Projects/WallApps/WallAppLibrary/src/runtime/context/UniversalContext.as:67]
at polls.context::RuntimePollContext/startup()[/Projects/WallApps/WallAppLibrary/src/polls/context/RuntimePollContext.as:39]
at org.robotlegs.mvcs::Context/checkAutoStartup()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/mvcs/Context.as:261]
at org.robotlegs.mvcs::Context()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/mvcs/Context.as:90]
at runtime.context::UniversalContext()[/Projects/WallApps/WallAppLibrary/src/runtime/context/UniversalContext.as:47]
at polls.context::RuntimePollContext()[/Projects/WallApps/WallAppLibrary/src/polls/context/RuntimePollContext.as:35]
at PollRunTime/___PollRunTime_BaseWallAppRuntimeApp1_preinitialize()[/Projects/WallApps/newWallApp/src/PollRunTime.mxml:19]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
...
The main Application has no references to Robotlegs. I am using version 1.4, but have tried some of the fixes discussed here anyway http://knowledge.robotlegs.org/discussions/problems/160-child-appli... . Is it mandatory to use ModuleContext when you use a Module, even if the main application has no references to RL and loads no other modules?
Thanks;
Amy
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Amy on 24 Jun, 2011 08:50 PM
OK, so I decided to try getting the source to RL and replacing SwitftSuspenders with the latest. Unfortunately, when I try to dl swiftSuspenders 1.6.0, I get
AccessDenied
Access Denied
8412FCB65163A93D
CgLfnuMZtEMQfBDxzyoDUg1nYSJKhNDWtUiTT6EhoIuSt5ZTAqx45D/LUfQbzRqw
I can download the previous version with no problem. I'd rather not have to have my project compile both SS and RL. Can anyone send me the swc for SwiftSuspenders at amy at magnoliamultimedia dot com?
Thanks;
Amy
2 Posted by Amy on 24 Jun, 2011 08:58 PM
Update: I found the swc in the full zip, and I tried it. Still getting the error.
Thanks;
Amy
Support Staff 3 Posted by creynders on 25 Jun, 2011 07:33 AM
AFAIK it is mandatory to extend ModuleContext. This definitely has something to do with application domains. Do you load the module in its own application domain or in the main application's application domain?
4 Posted by Amy Blankenship on 25 Jun, 2011 05:15 PM
I'm trying to avoid adding yet another library to my project. I did not touch the ApplicationDomain, just let ModuleLoader do whatever it does (because I will not have any control over what the ModuleLoader does that will load it in the real world). I didn't dig into ModuleLoader's source code to see what it does.
I am mystified as to why this would be necessary, though, since the main application knows nothing about RobotLegs. I thought Modules should only become an issue if RobotLegs is loaded from the main app or another module first.
creyenders (do you have a real name you're willing to share?), do you have any insight into the whys and wherefores of why it would be mandatory in this situation, so I can figure out exactly how much meaning "AFAIK" really has?
Thanks;
Amy
5 Posted by Amy on 26 Jun, 2011 04:55 PM
OK, I tried extending ModuleContext instead of Context, and it did work. However, I'm still not clear on why this would be necessary, since the main application domain has no idea RobotLegs even exists.
One thing I found that was strange was that I would get different variables not defined. I rearranged my mapInjections, and then I'd get ICommandMap not defined. If I added SwiftSuspendersInjector(injector).setApplicationDomain(contextView.loaderInfo.applicationDomain); in the constructor, I would get IMediatorMap not defined.
Without spending a lot of time debugging, it suggests to me that, even with adding this, somehow the injector might have wound up with two different ApplicationDomains in that second scenario. Is it remotely possible that this could be related to all the injection mapping warnings (whatever logic in there is running twice, could it somehow have created two injectors with different domains)?
One thing I did notice is that Flex creates the ApplicationDomain differently for Flex 4 projects than Flex 3 projects. It seems to me that this might well be revealing an issue in Robotlegs 1.4 (which was supposed to fix basic modular problems) that wasn't caught in testing. Also, I haven't looked at your tests (deadlines and all), but did you test for a scenario where Robotlegs was used in a module but not in the parent Application?
If possible, I'd really like to get rid of the Modular Utilities from my project--I don't need most of what it offers. I just need my module to run without breaking.
Thanks;
Amy
Support Staff 6 Posted by creynders on 27 Jun, 2011 07:26 AM
There's been a lot of problems with the application domains in RL and SS, so I've got a bit of a hard time remembering the entire track of problems/solutions, that's why I recommended using the ModuleContext even though it's not (or should not be) necessary.
If I've got time today I'm gonna spike to see what's going on and how it possibly could be solved w/o using the modular utilities.
7 Posted by Amy on 27 Jun, 2011 12:04 PM
OK, thanks :). I have something that will get this project out the door on deadline, which is good enough for now.
Support Staff 8 Posted by creynders on 28 Jun, 2011 07:33 AM
Sorry, haven't had the time to spike it and it doesn't look like that will change this week. I'm sure the GOF (Gang Of Five :) ) will look into it when they return from Spain.
Ondina D.F. closed this discussion on 01 Nov, 2011 11:33 AM.