This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
If it is a web application you can also use org.springframework.web.context.ContextLoaderListe ner or org.springframework.web.context.ContextLoaderServl et to perform bootstrap initializations. In that case the initialization code is executed only once.
Using a BeanPostProcessor might be problematic if the configuration is processed more than once (e.g. if you initialize pooled EJBs). In that case your init-code will be executed multiple times.