【问题标题】:Quartz scheduler is running twiceQuartz 调度器运行两次
【发布时间】:2014-03-24 08:55:39
【问题描述】:

我已经创建了石英调度程序,但它运行了两次该方法。一些链接表明应用程序上下文加载了两次。我无法在 web.xml 中找到`

      <?xml version="1.0" encoding="UTF-8"?>
        <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
     id="WebApp_ID"
     version="2.5">

      <display-name>TimeSheetManagementSystems</display-name>
       <filter>
         <filter-name>LoginFilter</filter-name>
         <filter-class>com.agranee.timesheet.filter.LoginFilter</filter-class>
      </filter>
     <filter-mapping>
      <filter-name>LoginFilter</filter-name>
       <url-pattern>/pages/*</url-pattern>
      </filter-mapping>



      <!-- Spring Context Configuration' s Path definition -->
      <context-param>
        <param-name>contextConfigLocation</param-name>
         <param-value>
           /WEB-INF/applicationContext.xml
         </param-value>
      </context-param>



       <listener>
          <listener-class>
             org.springframework.web.context.ContextLoaderListener
          </listener-class>
       </listener>
       <listener>
       <listener-class>
           org.springframework.web.context.request.RequestContextListener
        </listener-class>
  </listener>



     <context-param>
       <param-name>javax.faces.PROJECT_STAGE</param-name>
       <param-value>Development</param-value>
     </context-param>



      <welcome-file-list>
         <welcome-file>login.xhtml</welcome-file>
      </welcome-file-list>


       <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
      </servlet>


       <servlet-mapping>
           <servlet-name>Faces Servlet</servlet-name>
           <url-pattern>*.xhtml</url-pattern>
      </servlet-mapping>
       <servlet-mapping>
         <servlet-name>Faces Servlet</servlet-name>
         <url-pattern>*.faces</url-pattern>
     </servlet-mapping>


        <filter>
            <filter-name>PrimeFaces FileUpload Filter</filter-name>
             <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
            <init-param>
              <param-name>thresholdSize</param-name>
              <param-value>51200</param-value>
           </init-param>
     </filter>


        <filter-mapping>
            <filter-name>PrimeFaces FileUpload Filter</filter-name>
            <servlet-name>Faces Servlet</servlet-name>
        </filter-mapping>


     </web-app>`

非常感谢任何帮助。

【问题讨论】:

  • 你能检查答案herehere
  • 您可以查看 Spring 调试日志以确定 Spring 上下文配置是否被初始化了两次。

标签: java spring jsf primefaces


【解决方案1】:

你可以在这里查看Too frequent load of Quartz Scheduler in a Spring application

很可能,在您的代码中,您加载了两次上下文。然后,每次调度器都会重新运行。

在您的 Java 类字符串“web.xml”中搜索并检查您加载此文件的次数。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多