MSC000001:无法启动Schedule类型的服务

时间:2017-10-19 17:33:00

标签: java scheduled-tasks ejb-3.1 job-scheduling jboss-eap-6

我正在重构一个负责执行预定作业的班级。所以,我刚刚删除了一个方法,现在.ear工件没有部署。

原班级:

@Stateless(name = "jobScheduleService")
public class JobScheduleService {

    @Inject
    private FormService formService;;

    @EJB
    private EliminationService eliminationService;

    @Schedules({
            @Schedule(hour = "23", minute = "50")
    })
    public void remind() throws MessagingException {
        formService.sendDeadlineReminder();
    }

    @Schedules({
            @Schedule(hour = "2", minute = "00")
    })
    public void eliminatesOutOfDate() {
        this.eliminationService.eliminatesOutOfDate();
    }
}

删除了eliminatesOutOfDate()方法的类:

@Stateless(name = "jobScheduleService")
public class JobScheduleService {

    @Inject
    private FormService formService;

    @Schedules({
            @Schedule(hour = "23", minute = "50")
    })
    public void remind() throws MessagingException {
        formService.sendDeadlineReminder();
    }
}

stacktrace

15:29:27,480 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.subunit."test-ear-1.11.0-DEV.ear"."test-ejb-1.0-SNAPSHOT.jar".component.jobScheduleService.ejb3.timerService: org.jboss.msc.service.StartException in service jboss.deployment.subunit."test-ear-1.11.0-DEV.ear"."test-ejb-1.0-SNAPSHOT.jar".component.jobScheduleService.ejb3.timerService: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1936) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
    at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
Caused by: java.lang.NullPointerException
    at org.jboss.as.ejb3.timerservice.TimerServiceImpl.doesTimeoutMethodMatch(TimerServiceImpl.java:928)
    at org.jboss.as.ejb3.timerservice.TimerServiceImpl.restoreTimers(TimerServiceImpl.java:679)
    at org.jboss.as.ejb3.timerservice.TimerServiceImpl.start(TimerServiceImpl.java:189)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
    ... 3 more

15:29:29,136 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 38) JBAS014612: Falha na operação ("deploy") - endereço ({"deployment" => "test-ear-1.11.0-DEV.ear"}) - falha na descrição: {"JBAS014671: Falha de serviços" => {"jboss.deployment.subunit.\"test-ear-1.11.0-DEV.ear\".\"test-ejb-1.0-SNAPSHOT.jar\".component.jobScheduleService.ejb3.timerService" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"test-ear-1.11.0-DEV.ear\".\"test-ejb-1.0-SNAPSHOT.jar\".component.jobScheduleService.ejb3.timerService: Failed to start service
    Caused by: java.lang.NullPointerException"}}
15:29:29,136 ERROR [org.jboss.as.server] (management-handler-thread - 38) JBAS015870: O procedimento da implantação "test-ear-1.11.0-DEV.ear" foi revertido com falha de mensagem 
{"JBAS014671: Falha de serviços" => {"jboss.deployment.subunit.\"test-ear-1.11.0-DEV.ear\".\"test-ejb-1.0-SNAPSHOT.jar\".component.jobScheduleService.ejb3.timerService" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"test-ear-1.11.0-DEV.ear\".\"test-ejb-1.0-SNAPSHOT.jar\".component.jobScheduleService.ejb3.timerService: Failed to start service
    Caused by: java.lang.NullPointerException"}}

我不明白为什么会发生异常。

1 个答案:

答案 0 :(得分:0)

尽管是Wildfly问题,但问题仍然存在({3}}