Announcement Announcement Module
Collapse
No announcement yet.
Problem loading context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem loading context

    Hi,

    I have around 100 beans in several context files. The contexts are loaded with the import element from a container context.

    I have been unable to load all of the beans as 1 bean (isolated the hard way i.e. conquer and devide) fails to load. I currently have this in its own seperate context but an unable to detime WHY it will not load.

    I have the log4j rootLogger set to DEBUG in my log4j.properties file but spring debugging does not tell me why I get the problem. Also it seems to me that the beans are being instanciated even though I have lazy-init="true" in the definitions of all singletons.

    Here is an excert from the log4j output while loading the contexts

    Code:
    INFO  ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:02,564 -U004ec5713b610b7d12543a- XmlBeanDefinitionReader (278) - Loading XML bean definitions from URL [zip:C:/bea/weblogic81/config/cscdomain/cscserver/.wlnotdelete/extract/cscserver_Infoscreen_infoscreen/jarfiles/WEB-INF/lib/ecrm-spring-context-Release1660402.jar!/webRefFactory.xml]
    ...
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:03,455 -U004ec5713b610b7d12543a- BeansDtdResolver (65) - Found beans DTD [http://www.springframework.org/dtd/spring-beans.dtd] in classpath
    ...
    INFO  ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:03,746 -U004ec5713b610b7d12543a- XmlBeanDefinitionReader (278) - Loading XML bean definitions from URL [zip:C:/bea/weblogic81/config/cscdomain/cscserver/.wlnotdelete/extract/cscserver_Infoscreen_infoscreen/jarfiles/WEB-INF/lib/ecrm-spring-context-Release1660402.jar!/applicationContext.xml]
    ...
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:06,039 -U004ec5713b610b7d12543a- DefaultXmlBeanDefinitionParser (102) - Found [34] <bean> elements in [URL [zip:C:/bea/weblogic81/config/cscdomain/cscserver/.wlnotdelete/extract/cscserver_Infoscreen_infoscreen/jarfiles/WEB-INF/lib/ecrm-spring-context-Release1660402.jar!/applicationContext.xml]].
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:06,049 -U004ec5713b610b7d12543a- DefaultXmlBeanDefinitionParser (266) - Imported 34 bean definitions from relative location [applicationContext.xml]
    INFO  ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:06,059 -U004ec5713b610b7d12543a- XmlBeanDefinitionReader (278) - Loading XML bean definitions from URL [zip:C:/bea/weblogic81/config/cscdomain/cscserver/.wlnotdelete/extract/cscserver_Infoscreen_infoscreen/jarfiles/WEB-INF/lib/ecrm-spring-context-Release1660402.jar!/jmxMonitoringApplicationContext.xml]
    ...
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,082 -U004ec5713b610b7d12543a- DefaultXmlBeanDefinitionParser (266) - Imported 12 bean definitions from relative location [helperApplicationContext.xml]
    INFO  ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,092 -U004ec5713b610b7d12543a- XmlBeanDefinitionReader (278) - Loading XML bean definitions from URL [zip:C:/bea/weblogic81/config/cscdomain/cscserver/.wlnotdelete/extract/cscserver_Infoscreen_infoscreen/jarfiles/WEB-INF/lib/ecrm-spring-context-Release1660402.jar!/DAOApplicationContext.xml]
    ...
    U004ec5713b610b7d12543a- DefaultXmlBeanDefinitionParser (102) - Found [82] <bean> elements in [URL [zip:C:/bea/weblogic81/config/cscdomain/cscserver/.wlnotdelete/extract/cscserver_Infoscreen_infoscreen/jarfiles/WEB-INF/lib/ecrm-spring-context-Release1660402.jar!/DAOApplicationContext.xml]].
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,933 -U004ec5713b610b7d12543a- DefaultXmlBeanDefinitionParser (266) - Imported 26 bean definitions from relative location [DAOApplicationContext.xml]
    INFO  ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,943 -U004ec5713b610b7d12543a- XmlBeanDefinitionReader (278) - Loading XML bean definitions from URL [zip:C:/bea/weblogic81/config/cscdomain/cscserver/.wlnotdelete/extract/cscserver_Infoscreen_infoscreen/jarfiles/WEB-INF/lib/ecrm-spring-context-Release1660402.jar!/problemApplicationContext.xml]
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,943 -U004ec5713b610b7d12543a- XmlBeanDefinitionReader (334) - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@1472dca]
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,963 -U004ec5713b610b7d12543a- ResourceEntityResolver (92) - Attempting to resolve DTD [http://www.springframework.org/dtd/spring-beans.dtd] using [org.springframework.beans.factory.xml.BeansDtdResolver].
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,973 -U004ec5713b610b7d12543a- BeansDtdResolver (51) - Trying to resolve XML entity with public ID [-//SPRING//DTD BEAN//EN] and system ID [http://www.springframework.org/dtd/spring-beans.dtd]
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,973 -U004ec5713b610b7d12543a- BeansDtdResolver (57) - Trying to locate [spring-beans.dtd] in Spring jar
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,973 -U004ec5713b610b7d12543a- BeansDtdResolver (65) - Found beans DTD [http://www.springframework.org/dtd/spring-beans.dtd] in classpath
    DEBUG ExecuteThread: '13' for queue: 'default' 2006-05-29 00:17:08,993 -U004ec5713b610b7d12543a- DefaultXmlBeanDefinitionParser (90) - Loading bean definitions
    The end of this log entry is literally the end of the log file i.e. it fails to complete loading of the problemApplicationContext.xml file (all others are fine) containing a single bean. The code freezes here and I never get past this point.

    I need to get more information out of Spring.....

    problemApplicationContext.xml (DTD removed)
    Code:
    <beans>
    	
      <bean id="productDAO" class="com.o2.germany.salcusapi.ejbserver.dao.ProductDAO" 
    		singleton="true"
    		lazy-init="true"/>
    </beans>
    The code that loads the context webRefFactory
    Code:
    ApplicationContext appContext = new ClassPathXmlApplicationContext("classpath*:webRefFactory.xml");
    infoScreen = (IInfoScreen)appContext.getBean(IInfoScreen.ID);
    Second line never gets executed. All contexts live in a single context jar file.

    The webRefFactory (DTD removed)
    Code:
    <beans>
    	<import resource="applicationContext.xml" />
    	<import resource="jmxMonitoringApplicationContext.xml" />
    	<import resource="helperApplicationContext.xml" />	
    	<import resource="DAOApplicationContext.xml" />
    	<import resource="problemApplicationContext.xml" />	
    </beans>

  • #2
    Second line never gets executed. All contexts live in a single context jar file.
    do you get any Exception on 1st line?

    Comment


    • #3
      Hi,

      No exceptions appear in any log file or on the console.

      Regards

      Steve

      Comment


      • #4
        Sorry, I may be missing something here, what do you mean by
        Second line never gets executed.

        Comment


        • #5
          I mean the line that loads the bean from the context.

          infoScreen = (IInfoScreen)appContext.getBean(IInfoScreen.ID);

          Regards

          Comment

          Working...
          X