在jboss中部署spring boot项目后,调度任务无法正常工作,除了调度任务外,每件事情都运行良好

时间:2017-07-20 06:56:14

标签: spring spring-boot deployment jboss

在jboss中部署spring boot项目后调度任务不起作用,除了日程安排任务外,每件事情都运行良好

@SpringBootApplication
@EnableScheduling
public class Application  extends SpringBootServletInitializer{

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder 
application) {
    return application.sources(Application.class);
}

public static void main(String[] args) throws Exception           
SpringApplication.run(Application.class);
}
}

//this is schedule task class in diffrent package

@Component
public class ScheduledTasks {
scheduled(fixedDelay = 5000)
public void reportCurrentTime() {
    log.info("The time is now {}", dateTest.format(new Date()));

}

0 个答案:

没有答案