Monthly Archives: January 2009

Strange IMPORT failure in Spring AS

So I’ve started to think about splitting up the main applicationContext.xml file in one of my projects. The current one is getting quite large. Spring AS has the ability to import bean/object definitions from another XML file of your choice such as the following example where my context defines one object “yObject” and then declares an import to bring in another XML file which contains further object definitions:

<objects....>
  <object id="yObject" class="my.package.YObject"/>
  <import file="subConf.xml"/>
</objects>

The contents of “subConf.xml” file look as follows:

<objects....>
<object id="zObject" class="my.package.ZObject"/>
</objects>

After booting up Spring AS, I can successfully retrieve “yObject” however “zObject” is null. I have also tried specifying the subConf.xml file explicitly via a full path to no avail. I’ve been following the docs to the tee and this simply has made no sense! So after hours of fiddling with this and going through debugging the source code for Prana directly I found that when the following header that is in the objects tag the e4x “xml.descendants(“import”)” call within XMLObjectFactory._addImportLocationsIfAny() yields zero results.

<objects xmlns="http://www.pranaframework.org/objects"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.pranaframework.org/objects

http://www.pranaframework.org/schema/objects/spring-actionscript-objects.xsd">

When I remove all the xmlns/schema info OUT of the tag. The xml.descendants(“import”) works fine. Huh? Seems like an e4x bug?

[UPDATE 1/24 this is now fixed in the Prana source in SVN]

Tagged , ,
Follow

Get every new post delivered to your Inbox.