Hello!
I experience a very strange behaviour at application startup, for which i do not find an explanation.
I have a singleton bean defined in the application context:
When i start my application, i get the following output (note that "Creating shared instance of singleton bean 'eventMulticaster' " appears twice).Code:<bean id="eventMulticaster" class="org.springframework.context.event.ApplicationEventMulticasterImpl"/>
I do not know why this bean is created twice, and why some of my classes get bean 1 and others bean 2.Code:... Loading XML bean definitions from resource [/WEB-INF/bwz-servlet.xml] of ServletContext 2004-09-06 15:50:56,872 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] Loading XML bean definitions from resource [/WEB-INF/bwz-security.xml] of ServletContext 2004-09-06 15:50:57,193 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] Loading XML bean definitions from resource [/WEB-INF/bwz-db-hibernate.xml] of ServletContext 2004-09-06 15:50:57,332 INFO [org.springframework.web.context.support.XmlWebApplicationContext] Bean factory for application context [Root XmlWebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [(...)]; Root of BeanFactory hierarchy 2004-09-06 15:50:57,362 INFO [org.springframework.web.context.support.XmlWebApplicationContext] 58 beans defined in ApplicationContext [Root XmlWebApplicationContext] ... 2004-09-06 15:50:57,624 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'eventMulticaster' ... Published root WebApplicationContext [org.springframework.web.context.support.XmlWebApplicationContext: displayName=[Root XmlWebApplicationContext]; startup date=[Mon Sep 06 15:50:55 CEST 2004]; root of ApplicationContext hierarchy; config locations=[/WEB-INF/bwz-servlet.xml,/WEB-INF/bwz-security.xml,/WEB-INF/bwz-db-hibernate.xml]; ] as ServletContext attribute with name [interface org.springframework.web.context.WebApplicationContext.ROOT] 2004-09-06 15:52:38,355 INFO [org.springframework.web.servlet.DispatcherServlet] Initializing servlet 'bwz' 2004-09-06 15:52:38,423 INFO [org.springframework.web.servlet.DispatcherServlet] Framework servlet 'bwz' init 2004-09-06 15:52:38,424 INFO [org.springframework.web.servlet.DispatcherServlet] Servlet with name 'bwz' will try to create custom WebApplicationContext context of class 'org.springframework.web.context.support.XmlWebApplicationContext' using parent context [org.springframework.web.context.support.XmlWebApplicationContext: displayName=[Root XmlWebApplicationContext]; startup date=[Mon Sep 06 15:50:55 CEST 2004]; root of ApplicationContext hierarchy; config locations=[/WEB-INF/bwz-servlet.xml,/WEB-INF/bwz-security.xml,/WEB-INF/bwz-db-hibernate.xml]; ] ... 2004-09-06 15:56:24,735 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'eventMulticaster'
I saw the lines which say that a context for servlet bwz with the root context as parent is constructed. But i do not know what this means... i only have one servlet with application contexts and do not try to build up parent-child-contexts (at least not to my knowledge...!).
Does somebody have an idea? I am a bit lost after searching around for three hours...
Thanks a lot!
Sebastian


Reply With Quote