我正在尝试通过以下链接进行石英计划:QUARTZ+SPRING
但是,当我在一条玻璃鱼上运行时,它会使这项工作成为7次。
的applicationContext.xml
<bean id="exampleBusinessObject" class="cz.elit.ediplus.core.dao.ExampleBusinessObject"
p:companyService-ref="CompanyService"
p:invoiceService-ref="InvoiceService"
p:orderService-ref="OrderService"
p:packingListService-ref="PackingListService" />
<bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="exampleBusinessObject"/>
<property name="targetMethod" value="doIt"/>
<property name="concurrent" value="false"/>
</bean>
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="jobDetail"/>
<property name="startDelay" value="10000"/>
<property name="repeatInterval" value="300000"/>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="simpleTrigger"/>
</list>
</property>
</bean>
和web.xml中的一些代码
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>jaxws-servlet</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
有谁知道错误可能在哪里?我读了一些论坛,但没有效果。奇怪的是,当我在localhost上运行它时,作业只运行一次,但是当我在主服务器上部署它时,该作业运行了七次。