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:

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

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

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

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=""

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]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s