PDA

View Full Version : applicationContext Loading Order


todds
Nov 24th, 2004, 10:30 PM
I have a remoting-context.xml file that references a bean defined in my applicationContext.xml file.
When I run in tomcat, the remoting file is loading first, and throwing an error because it can't find the bean defined, (which of course will be loaded when applicationContext.xml loads).
This will be a cyclical pattern because my bean is a dao, which will then use the session etc etc.

Is there a way to guarantee loading order, or is there another rule I should be following?

klr8
Nov 25th, 2004, 02:21 PM
You could try using depends-on: http://www.springframework.org/docs/reference/beans.html#beans-factory-dependson.

Erwin

todds
Nov 26th, 2004, 05:07 PM
Thanks for the tip.
I have actually solved this problem now by using a different listener in web.xml.

rstearns01
Nov 26th, 2004, 05:16 PM
Could you provide some details?

cyalla
Jul 5th, 2008, 01:19 PM
hi todds,

I am having the same problem , I have one applicationContext.xml having datasource,session beans and other applicationContext-admin.xml file using the beans defined in first applicationContex.xml file. I am getting error while loading second file as it can find beans defined in applicationContex.xml.

Can you provide me the fix you have done using some listener in web.xml.

Regards,
Chandra