Announcement Announcement Module
Collapse
No announcement yet.
CDATA throws Err #1009: Cannot access a property or method of a null object reference Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CDATA throws Err #1009: Cannot access a property or method of a null object reference

    Hi!

    I'm trying to load a CDATA property inside an AS object but I'm receiving the following error:

    Code:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support.nodeparsers::AbstractNodeParser/canParse()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseProperty()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/::parseProperties()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseObjectDefinition()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseAndRegisterObjectDefinition()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support.nodeparsers::ObjectNodeParser/parse()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support.nodeparsers::ArrayNodeParser/parse()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseProperty()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/::parseProperties()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseObjectDefinition()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseAndRegisterObjectDefinition()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support.nodeparsers::ObjectNodeParser/parse()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support.nodeparsers::ArrayNodeParser/parse()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseProperty()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/::parseProperties()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseObjectDefinition()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parseAndRegisterObjectDefinition()
    	at org.springextensions.actionscript.ioc.factory.xml.parser.support::XMLObjectDefinitionsParser/parse()
    	at org.springextensions.actionscript.ioc.factory.xml::XMLObjectFactory/::_doParse()
    	at org.springextensions.actionscript.ioc.factory.xml::XMLObjectFactory/::_loadNextProperties()
    	at org.springextensions.actionscript.ioc.factory.xml::XMLObjectFactory/::_loadNextConfigLocation()
    	at org.springextensions.actionscript.ioc.factory.xml::XMLObjectFactory/::_onLoaderComplete()
    	at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    	at flash.events::EventDispatcher/dispatchEvent()
    	at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    My XML looks like:

    Code:
    <object id="object1" class="com.test.MyObject">
       <property name="ID" value="1" />
       <property name="Text"><![CDATA[Túrismo de aventura]]></property>
    </object>
    And my class:

    Code:
    package com.test
    {
       public class MyObject
       {   
    		public function Respuesta() { 
    			_ID = 0;
    			_text = "";
    		}
    		protected var _ID:Number;
    		protected var _text:String;
    		
    		public function set ID(value:Number):void { _ID = value; }
    		public function get ID():Number { return _ID; }
    		public function set Text(value:String):void { _text = value; }
    		public function get Text():String { return _text; }
       }
    }
    If load the property with the value attribute, everything works fine. Am I missing something?

    Thanks a lot for your help!

  • #2
    Hi,

    it seems like you forgot to add the "value" element inside the "property" element.

    Code:
    <object id="object1" class="com.test.MyObject">
       <property name="ID" value="1" />
       <property name="Text">
          <value><![CDATA[Túrismo de aventura]]></value>
       </property>
    </object>
    Can you confirm that it works with this change?

    regards,
    Christophe

    Comment


    • #3
      Solved!

      Thanks a lot, it worked

      Comment

      Working...
      X