在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()));
}