Spring ClassPathXmlApplicationContext不断刷新

时间:2014-03-05 20:59:27

标签: java spring

我的webapp使用iText动态创建PDF。 GlassFish线程池用于在单独的线程中处理每个PDF。整个应用程序中都会出现Spring以进行依赖注入。该应用程序的所有模块都可以通过单独的UI应用程序中的Web服务进行访问。

问题: Spring在运行时不断刷新。它似乎主要发生在调用其中一个Web服务之后。该服务相对简单,它使用Spring注入的服务/ DAO接口(通过XML配置)。没有直接使用Spring或调用refresh()的Java代码。

几乎每次调用上述服务后,我都会在日志文件中看到这个:

INFO ClassPathXmlApplicationContext:411 - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@26fa7f9: display name [org.springframework.context.support.ClassPathXmlApplicationContext@26fa7f9]; startup date [Fri Feb 28 07:50:01 CST 2014]; root of context hierarchy
INFO XmlBeanDefinitionReader:323 - Loading XML bean definitions from class path resource [locale.xml]
INFO ClassPathXmlApplicationContext:426 - Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@26fa7f9]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1b5c2f0c
INFO DefaultListableBeanFactory:414 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1b5c2f0c: defining beans [messageSource]; root of factory hierarchy

请帮助我理解为什么Spring一直都很清爽。我认为Spring只应该在启动时进行初始化。

1 个答案:

答案 0 :(得分:2)

这可能不是春天的问题。 Glassfish使用热部署系统。每次更改文件或将文件添加到文件系统时,它都将重新部署所有资源。我建议在服务器部署目录之外创建文件。