简体   繁体   English

JBoss上的Spring Boot部署问题

[英]Spring boot deployment issue on jboss

After deploying spring boot project on jboss ,every things work great except my schdule task.i have annotated my main class with @enablescheduling and @component on my schedule method class and @scheduled on my method.but after running successfuly without error on jboss ,my schedule task does not fire.i really need a solution. 在jboss上部署spring boot项目之后,除我的schdule任务外,其他所有工作都很好。我在我的schedule方法类上用@enablescheduling和@component注释了我的主类,并在我的方法上使用了@scheduled注释了我的主类。我的日程安排任务没有触发。我确实需要解决方案。 Tnx every body Below is my config class and my schedule classes: Tnx每个主体下面是我的配置类和计划类:

@SpringBootApplicatio
@Enablescheduling
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
      SpringApplication.run(Application.class);              

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

@component
Public class test{
@scheduled(fixedDelay = 1000)
Public void print(){
//do sth
}

}
@SpringBootApplicatio
@Enablescheduling
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
      SpringApplication.run(Application.class);              

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

@component
Public class test{
@scheduled(fixeddelay.....)
Public void print(){
//do sth
}

}

Ok, we've found an issue. 好的,我们发现了一个问题。 Setting initialDelay to 10000 ms resolved the problem in our case. 在本例中,将initialDelay设置为10000 ms可以解决该问题。 Don't know an explanation but still: it works. 不知道任何解释,但仍然可以:它有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM