Its Back, Injector is missing a rule........

visnik's Avatar


06 Jul, 2011 05:34 PM

About a month ago, I had an the following error: Injector is missing a rule to handle injection into target as seen in this post. It was solved once I deleted a class and re-created it.

I just created a new project and I am getting the same error. So I deleted the affected class and created a new one, and I am still getting this error. This either means I am doing something wrong, or just don't understand aspects of mapping within robot legs like I thought i did. here is what I've got going on.

I have an air 2.6 project with the following line of code in my context class.
injector.mapClass(ICharacterService, CharacterService);

In my command I inject my service like so
[Inject] public var service:ICharacterService;

in the execute method of the command I call a method to the service:

My CharacterService class extends the RL Actor class and implments my ICharacterService, and I get the Injector is missing a rule error again.

Dealing with another Issue, I tried applying some remedies listed by Ondina D.F. located here
and looking at some common problems

My head is starting to hurt from all the banging against the wall. What do I keep missing or doing wrong?


  1. Support Staff 1 Posted by Stray on 06 Jul, 2011 05:49 PM

    Stray's Avatar

    Hi Joe,

    can you paste the whole error message? It might not be for the service - but the IEventDispatcher that it's missing? Or something else entirely...

    I'm sure we can help you out,


  2. 2 Posted by visnik on 06 Jul, 2011 06:15 PM

    visnik's Avatar


    Here is the entire error:

    `Error: Injector is missing a rule to handle injection into target [object InitialCommand]. Target dependency: com.projectrenascent.service::ICharacterService

    at org.swiftsuspenders.injectionpoints::PropertyInjectionPoint/applyInjection()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/injectionpoints/]
    at org.swiftsuspenders::Injector/injectInto()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/]
    at org.swiftsuspenders::Injector/instantiate()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/]
    at org.robotlegs.base::CommandMap/execute()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/base/]
    at org.robotlegs.base::CommandMap/routeEventToCommand()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/base/]
    at Function/<anonymous>()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/base/]
    at org.robotlegs.base::ContextBase/dispatchEvent()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/base/]
    at com.projectrenascent.context::CharacterCreationContext/startup()[C:\Users\jcolumbe\Desktop\Flash Builder WorkSpaces\ProjectRenescent\CharacterCreationMenu\src\com\projectrenascent\context\]
    at org.robotlegs.mvcs::Context/onAddedToStage()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/mvcs/]
    at flash.display::DisplayObjectContainer/addChildAt()
    at mx.managers::SystemManager/preloader_preloaderDoneHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\]
    at mx.preloaders::Preloader/displayClassCompleteHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\]
    at mx.preloaders::SparkDownloadProgressBar/initCompleteHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\]
    at mx.preloaders::Preloader/dispatchAppEndEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\]
    at mx.preloaders::Preloader/appCreationCompleteHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\]
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\]
    at mx.core::UIComponent/set initialized()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\]`


  3. 3 Posted by Stray on 06 Jul, 2011 07:05 PM

    Stray's Avatar

    Hi Joe - ok, so, normally this would be race conditions.

    Following the stack trace, I can see the InitialCommand is being fired in response to the startup dispatching an event (probably ContextEvent.STARTUP_COMPLETE ).

    Is there any chance that the event is being fired before you have made the ICharacterService mapping?


  4. 4 Posted by visnik on 06 Jul, 2011 07:17 PM

    visnik's Avatar

    I am such a moron , that was exactly it. Thank you Stray!

  5. 5 Posted by Stray on 06 Jul, 2011 07:28 PM

    Stray's Avatar

    You're not a moron at all! Believe me, it's (almost) *always* race conditions...

  6. Stray closed this discussion on 07 Jul, 2011 04:16 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? 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