问题描述
在tomcat下可以运行定时任务,但发布到webshpere上,好像就是不启动以下为定时任务的配置<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEbeansPUBLIC"-//SPRING//DTDBEAN//EN""http://www.springframework.org/dtd/spring-beans.dtd"><beans><beanname="taskJob"class="com.util.TaskJob"/><beanid="test"class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"><propertyname="targetObject"><refbean="taskJob"/></property><propertyname="targetMethod"><value>test</value></property></bean><beanid="cronTrigger1"class="org.springframework.scheduling.quartz.CronTriggerBean"><propertyname="jobDetail"><refbean="test"/></property><propertyname="cronExpression"><value>00/1***?</value></property></bean><beanclass="org.springframework.scheduling.quartz.SchedulerFactoryBean"><propertyname="triggers"><list><reflocal="cronTrigger1"/></list></property></bean></beans>在web.xml中配置如下(部分):<context-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/TimerConfig.xml</param-value></context-param><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>