Its Back, Injector is missing a rule........
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
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
Support Staff 1 Posted by Stray on 06 Jul, 2011 05:49 PM
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 Posted by visnik on 06 Jul, 2011 06:15 PM
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
Thanks,
Joe
3 Posted by Stray on 06 Jul, 2011 07:05 PM
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 Posted by visnik on 06 Jul, 2011 07:17 PM
I am such a moron , that was exactly it. Thank you Stray!
5 Posted by Stray on 06 Jul, 2011 07:28 PM
You're not a moron at all! Believe me, it's (almost) *always* race conditions...
Stray closed this discussion on 07 Jul, 2011 04:16 PM.