2

We have a fairly large Flex application and our QA were getting random, but reproducible, errors that the Flex developers couldn't reproduce. Some of these errors were being thrown from the flash player debug version such as:

ReferenceError: Specified ApplicationDomain does not contain the class ::LineSeriesLegendMarker
    at org.spicefactory.lib.reflect::ClassInfo$/getClassDefinitionByName()
    at org.spicefactory.lib.reflect::ClassInfo$/getClassInfo()
    at org.spicefactory.lib.reflect::ClassInfo$/forInstance()
    at org.spicefactory.parsley.core.view.impl::DefaultViewConfigurator/getDefinitionByType()
    at org.spicefactory.parsley.core.view.impl::DefaultViewConfigurator/getDefinition()
    at org.spicefactory.parsley.core.view.handler::ViewAutowireHandler/processAutowireEvent()
    at org.spicefactory.parsley.core.view.util::ContextAwareEventHandler/handleEvent()
    at org.spicefactory.parsley.core.view.handler::ViewAutowireHandler/handleAutowireEvent()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.spicefactory.parsley.core.view.handler::ViewAutowireHandler/prefilterView()
    at flash.display::DisplayObjectContainer/addChildAt()
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$addChildAt()
    at mx.core::Container/addChildAt()
    at mx.core::Container/addChild()
    at mx.charts::Legend/addLegendItem()
    at mx.charts::Legend/populateFromArray()
    at mx.charts::Legend/commitProperties()
    at mx.core::UIComponent/validateProperties()
    at mx.managers::LayoutManager/validateProperties()
    at mx.managers::LayoutManager/doPhasedInstantiation()
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()

Other errors include comboboxes not being populated correctly and what seems to be just general timing issues.

I'd like to emphasize that we've narrowed this down to our our main SWF with no other variables except the mxmlc parameter -debug=true vs -debug=false. Has anyone else encountered this or know why the builds would be resulting in different behavior?

J_A_X
  • 12,857
  • 1
  • 25
  • 31
vershun
  • 23
  • 3

1 Answers1

0

You're going to have to show more code than that; mostly your parsley config.

The difference between debug=true and debug=false is that debug=true will not trace errors in the end product. Your developers should always run with debug=true and have the Flash Player Debug installed.

Also, I'm curious as to why Parsley needs to know about view components. Are you using the Configure tag? I recommend you do not use it and instead use FastInject with proper presenter models which is better for testability. Configure means that Parsley have to reflect all the properties within your view which is useless and time consuming. I guarantee if you use FastInject instead of Configure that your problem would disappear. That is unless you're trying to inject a view into a components, which you shouldn't do. If that's the case, you'll need to architect your application in a better way.

J_A_X
  • 12,857
  • 1
  • 25
  • 31
  • Thanks this helped. It seems that autowiring being on was the primary problem. By getting rid of the autowiring and using Configure and FastInject (depending on if we were using Parsley's messaging features) the problem seemed to go away. I'm still curious why we were only seeing this error when the debug compiler flag was false. – vershun Jun 30 '11 at 18:15
  • I can't comment without seeing more code, but I got a sneaky suspicion that you're not using parsley properly. – J_A_X Jun 30 '11 at 18:51
  • That could definitely be the case. This isn't really an issue since we're not using autowiring anymore, but for curious parties I was able to reproduce this in a very small project using an area chart provided by an Adobe example and a context containing a view which is the chart's parent. http://www.vershun.com/projects/flexdebugbug/Test.fxp If you run it after import you'll see it throws the error. Editing the compiler flags and setting debug to true will hide the error. My best guess so far is the debug mode doesn't honor scoping the same way non-debug compiled swfs do. – vershun Jul 05 '11 at 22:43
  • @vershun, Parsley isn't made to inject (and reflect) view components. That's the whole reason parsley exist is to separate out the view from the business. If you have a view in your config, you should remove it. I think your issue is with timing, since debug mode is 'slower' to initialize. – J_A_X Jul 06 '11 at 13:22