0 Replies Latest reply on Sep 28, 2011 2:01 AM by Karl_Sigiscar_1971

    ReferenceError: Specified ApplicationDomain does not contain the class XXXXXXX

    Karl_Sigiscar_1971 Level 3

      We had the following runtime error on a project using Parsley when we were instantiating a component of a third party library in a module:

       

      ReferenceError: Specified ApplicationDomain does not contain the class XXXXXXX

          at org.spicefactory.lib.reflect::ClassInfo$/getClassDefinitionByName()[/Users/jenshalm/Proje cts/SpicefactoryProduction/Parsley/spicelib-reflect/org/spicefactory/lib/reflect/ClassInfo .as:153]

          at org.spicefactory.lib.reflect::ClassInfo$/getClassInfo()[/Users/jenshalm/Projects/Spicefac toryProduction/Parsley/spicelib-reflect/org/spicefactory/lib/reflect/ClassInfo.as:163]

          at org.spicefactory.lib.reflect::ClassInfo$/forInstance()[/Users/jenshalm/Projects/Spicefact oryProduction/Parsley/spicelib-reflect/org/spicefactory/lib/reflect/ClassInfo.as:120]

          at org.spicefactory.parsley.core.view.impl::DefaultViewConfigurator/getDefinitionByType()[/U sers/jenshalm/Projects/SpicefactoryProduction/Parsley/parsley-core/org/spicefactory/parsle y/core/view/impl/DefaultViewConfigurator.as:134]

       

      This error occurs during the object introspection Parsley performs for auto view wiring from the view root all the way down.

       

      Since we did not have the sources for the Flex library that was the cause of the problem, we needed to isolate this class in order for it to be ignored by Parsley.

       

       

      Module declaration

       

      <?xml version="1.0"?>

       

      <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"

                 xmlns:s="library://ns.adobe.com/flex/spark"

                 xmlns:mx="library://ns.adobe.com/flex/mx"

                 xmlns:spicefactory="http://www.spicefactory.org/parsley">

       

          <fx:Declarations>

       

              <spicefactory:ContextBuilder>

                  <spicefactory:ViewSettings autowireComponents="true"

                                            autowireFilter="{ new ApplicationsDefaultViewAutowireFilter() }"/>

                  <spicefactory:FlexConfig type="{DBAffinityApplicationsConfig}"/>

              </spicefactory:ContextBuilder>

       

              <s:TraceTarget includeCategory="true"

                             includeLevel="true"

                             includeTime="true"

                             level="{LogEventLevel.DEBUG}">

                  <s:filters>

                      <fx:String>org.spicefactory.parsley.*</fx:String>

                  </s:filters>

              </s:TraceTarget>

       

          </fx:Declarations>

       

       

      ApplicationsDefaultViewAutowireFilter.as


      package com.mycompany

      {

      import flash.display.DisplayObject;

      import flash.utils.getQualifiedClassName;

       

      import org.spicefactory.parsley.core.view.impl.DefaultViewAutowireFilter;

       

      public class ApplicationsDefaultViewAutowireFilter extends DefaultViewAutowireFilter

      {

          public function ApplicationsDefaultViewAutowireFilter()

          {

              super();

              this.eventType = "TEST_EVENT";

          }

       

          public override function prefilter( object:DisplayObject ):Boolean

          {

              if ( getQualifiedClassName( object ) == "XXXXXXX" )

              {

                  return false;

              }

              return super.prefilter( object );

          }

      }

      }

       

      Thanks to Josh for sorting that one out !