Injector not working in FDT
I'm compiling my robotlegs project using FDT4 m3 and I'm getting the following error:
Exception fault: TypeError: Error #1009: Cannot access a property or method of a null object reference.
This error is in a Command class where I'm setting up my model. The model consists of:
package com.project.controllers
{
import com.project.models.AppData;
import org.robotlegs.mvcs.Command;
public class ModelSetupCommand extends Command
{
override public function execute():void
{
trace("INJECTOR", this.injector); // Traces to null
injector.mapSingleton(AppData);
}
}
}
When I place the line
injector.mapSingleton(AppData);
in the context, it works fine. Also, it works fine when compiling using the CS3 to compile (with export SWC turned on). I get the same issue in every version of FDT that I've tried it with. This is a common convention that I use in my robotlegs projects and it all the sudden doesn't work. You think it's a robotlegs problem or an FDT problem?
Ideas?
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 Shaun Smith on 02 Aug, 2010 11:41 PM
Hi. It looks like the [Inject] metadata is being stripped out by the compiler (see: http://wiki.github.com/robotlegs/robotlegs-framework/common-problems ). Either use the Robotlegs SWC, or find out how to add the following compiler options in FDT:
2 Posted by Greg Kepler on 02 Aug, 2010 11:54 PM
Amazing. including the compiler option did it. Thanks man.
Support Staff 3 Posted by Shaun Smith on 03 Aug, 2010 12:03 AM
Cool, no problemo! Glad you're back on track.
Shaun Smith closed this discussion on 03 Aug, 2010 12:03 AM.