PureMVC Architects Lounge

Announcements and General Discussion => Fabrication => Topic started by: gregbown on September 12, 2009, 02:40:11



Title: proxyNameCache is null inside FabricationProxy
Post by: gregbown on September 12, 2009, 02:40:11
Error #1009: Cannot access a property or method of a null object reference. thrown on sendNotification inside a proxy

I have two proxies instantiated in my application startup command however one is coming up null unless I use a setTimeout inside the proxy to send notifications.  I tried changing the order of instantiation and even tried an addProxyCommand.

The debugger points to a null value inside FabricationProxy and sure enough proxyNameCache is null inside FabricationProxy line 212 unless I add some kind of delay in witch case it is fine.  The weird thing is both proxies send notifications so why does one throw the error and the other not.  They both have static public const NAME:String="Name of Proxy" and call super(NAME); in their constructor.  Both extend FabricationProxy

The only thing that prevents the error is using a setTimeout to send the notification


Title: Re: proxyNameCache is null inside FabricationProxy
Post by: gregbown on September 13, 2009, 10:22:51
Ok I think I found the answer but any of you more seasoned Fabrication guys can correct me if I'm wrong.
After some searching around I found this post http://lowpitch.com/blog/puremvc-multicore-vs-standard-singlecore/
So I thought I would check to see if that method was in FabricationProxy and it was. After adding the method to my proxy all is fine.

   override public function initializeNotifier(key:String):void {
         super.initializeNotifier(key);
         
         initializeProxyNameCache();
         // initialize methods in proxy after this
      }