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

visnik's Avatar

visnik

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:
service.updateName();

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?

Thanks,
Joe

  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,

    Stray

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

    visnik's Avatar

    Stray,

    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/PropertyInjectionPoint.as:42]
    at org.swiftsuspenders::Injector/injectInto()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/Injector.as:120]
    at org.swiftsuspenders::Injector/instantiate()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/Injector.as:134]
    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 com.projectrenascent.context::CharacterCreationContext/startup()[C:\Users\jcolumbe\Desktop\Flash Builder WorkSpaces\ProjectRenescent\CharacterCreationMenu\src\com\projectrenascent\context\CharacterCreationContext.as:63]
    at org.robotlegs.mvcs::Context/onAddedToStage()[/Development/Projects/Robotlegs/robotlegs-framework/src/org/robotlegs/mvcs/Context.as:271]
    at flash.display::DisplayObjectContainer/addChildAt()
    at mx.managers::SystemManager/preloader_preloaderDoneHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2670]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/displayClassCompleteHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\Preloader.as:582]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::SparkDownloadProgressBar/initCompleteHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\SparkDownloadProgressBar.as:1087]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/dispatchAppEndEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\Preloader.as:380]
    at mx.preloaders::Preloader/appCreationCompleteHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\preloaders\Preloader.as:590]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:13128]
    at mx.core::UIComponent/set initialized()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent.as:1818]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:842]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]`
    

    Thanks,
    Joe

  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?

    Stray

  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

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