Announcement Announcement Module
Collapse
No announcement yet.
Constructor arg of type String, pass in "" blank get an error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Constructor arg of type String, pass in "" blank get an error

    I have a constructor that takes a string. I am intentionally passing blank when I do a:

    <constructor-arg value=""/>

    Spring AS throws this error, rather than passing null or "" to my constructor

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at org.springextensions.actionscript.ioc.factory.xml. parser.support.nodeparsers::KeyValueNodeParser/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/parseConstructorArguments()
    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/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

  • #2
    Hi,

    this was indeed a bug when parsing empty strings as constructor arguments. It is fixed in SVN.

    Thanks for mentioning.

    - Christophe

    Comment


    • #3
      Hi Christophe,

      There is a simialar issue with intentionally passing a blank value to a property.

      <object class="Object">
      <property name="label" value="123"/>
      <property name="data" value=""/>
      </object>

      Spring AS throws this error, rather than passing null or "" to the object.

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at org.springextensions.actionscript.ioc.factory.xml. parser.support.nodeparsers::KeyValueNodeParser/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/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/onComplete()

      Thanks for your help,
      nickc

      Comment


      • #4
        Hi Nick,

        you can use the <null/> element for that. But perhaps the the parser should be smart enough to intercept this.

        Can you please file a bug in the Jira?

        regards,
        Christophe

        Comment


        • #5
          Hi Christophe,

          I logged a bug for the parser to handle the error being thrown.

          Here is the JIRA bug: http://jira.springframework.org/brow...IONSCRIPTAS-49

          Thanks for your prompt response,
          nickc

          Comment


          • #6
            Is this fix coming out in 0.9?

            Is the fix for this coming out in 0.9? and when will that be released?

            Comment


            • #7
              fixed already

              As far as I can see this issue has been resolved (at least that's the status in JIRA as you can see).
              It was fixed before the v0.8 release so it should work in the current version.
              If you still have problems with it, then please create a new issue in JIRA with a description of how to reproduce the problem.

              You can add issues in JIRA here:
              http://jira.springframework.org/brow...ACTIONSCRIPTAS

              cheers,

              Roland

              Comment

              Working...
              X