spring集成quartz,出现2次重复调用的问题
非web应用开发中,系统用Spring集成Quartz,也就是在Spring配置文件applicationContext.xml中配置Quartz,具体代码如下:
?
当我的系统启动时,会读取并实例化applicationContext.xml文件中的其他bean,出现的问题就是读取一次配置文件并实例化一个与Quartz不相关的bean时,代码如下:
?最后没办法,只得将applicationContext.xml文件中配置的Quartz代码移到另一个配置文件applicationContext-callJob.xml中,这样就避免了读取applicationContext.xml文件时自动实例化Quartz了。
?
1 楼 cyz001 2011-09-01 你加个判断,避免重复载入容器就行了