---
title: "springMvc定时器执行两次"
author: "ch_dj"
date: "2015-02-15T16:26:55Z"
tags: []
categories: ["Web前端"]
slug: "springmvc"
draft: false
lastmod: "2015-02-15T16:27:56Z"
id: 2186072
url: "https://ch-dj.iteye.com/blog/2186072"
---

用quartz 执行定时任务时，会执行2次，具体原因不详

先把定时的代码放到一个单独的配置文件中，然后在web.xml文件中加载这个定时的配置文件。


  contextConfigLocation
  
   classpath*:/applicationContext.xml,classpath*:/schedule.xml
  
我的定时配置文件：schedule.xml


原博客：
<http://blog.sina.com.cn/s/blog_9ed9ac7d0101f4eb.html>

附件是自己 项目的解决方法