Error: Injector is missing a rule........
I can't seem to figure out why I am getting the following error:
Error: Injector is missing a rule to handle injection into target [object IngredientInputMediator]. Target dependency: com.view.input::IngredientInput
The knowlege base states : "This error means that the injector has not been provided with an appropriate mapping to provide the dependency."
I have my view and mediator mapped in my context like so:
mediatorMap.mapView(IngredientInput, IngredientInputMediator);
and within my IngredientInputMediator I have the following:
[Inject] public var ingredient:IngredientInput;
I have does this several time throughout the rest of my app and all the others seem to work fine, does anyone have any possible ideas?
Thanks,
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 Till Schneidere... on 23 May, 2011 11:36 PM
Hey Joe,
that's weird. Are you perhaps creating the view in some other way than
the others? Normally, the view is automatically mapped in the injector
during creation of the mediator. Since I have no clue about how that
could possibly go wrong, my best guess is that you're creating the
mediator manually, but are still using the injector to do so.
If that's not the case, could you perhaps post some code that shows
the problem? If you don't feel like showing the code to everyone, you
can either make the ticket private in Tender, which would cause only
you and us members of the support-staff to be able to see it, or mail
it to me directly at [email blocked].
cheers,
till
2 Posted by Joe on 24 May, 2011 03:49 PM
I figured it was weird. I don't have anything special going on. I have no issue posting the code, it is just an app I am building to learn Robot legs.
Context.as
override public function startup():void
IngredientInput.mxml
<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
</s:HGroup>
ingredientInputMediator.as
public class IngredientInputMediator extends Mediator
3 Posted by Joe on 24 May, 2011 03:54 PM
related files attached. Thanks,
Support Staff 4 Posted by Till Schneidere... on 24 May, 2011 04:09 PM
Mmh, from these files I can't see any problems that would cause the
symptoms you're experiencing.
I'm afraid I still can't help you based on the information I currently
have. I would still offer you to send me the entire project by private
mail. If you don't want to do that, maybe I can tell you something
useful if you post the entire stacktrace from the exception you're
getting.
5 Posted by Stray on 24 May, 2011 04:18 PM
I can't see anything here either (just as a sanity check for Till!)
One question I have is whether the view is getting GC'd before the injection finishes... - though I'm not sure that's even possible, it depends whether Till has used his special weak references sauce in the injector at that point?
Also willing to cast my eye over the stack trace here,
Stray
Support Staff 6 Posted by Till Schneidere... on 24 May, 2011 04:31 PM
Thanks, Stray!
GC can't be the culprit: A mapping response is always strongly
referenced: How else would value and singleton mappings guarantee
their responses?
7 Posted by Stray on 24 May, 2011 04:39 PM
I thought as much - and the mediatorMap is using a hard reference... so... where on earth is it going? The mystery of the missing view...
8 Posted by Joe on 24 May, 2011 06:20 PM
All seems to be working now, I deleted the reference to the IngredientInput component from my application, saved it and put it back. No more error. I should have just done this from the beginning, however I do appreciate you guys taking the time to look at my files in order to help me out.
Thanks again,
Joe
9 Posted by Stray on 24 May, 2011 07:06 PM
No worries Joe - and thank goodness it was just a corrupt file somewhere - I was really scratching my head there.
Support Staff 10 Posted by Till Schneidere... on 24 May, 2011 07:53 PM
Thanks for the info - just as Stray, I'm glad you sorted it out and we
didn't have to fix some odd corner-case.
Ondina D.F. closed this discussion on 01 Nov, 2011 11:23 AM.