EJB 3.1 persistent calendar timer cause issues in EAP 6 if the implementation has changed

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Issue

  • If a method name of a persistent calendar timer is changed the re-deploy will fail with a NullPointerException like followed
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."ejb31-timer.jar".component.SimpleScheduleSingletonTimerBean.ejb3.timerService: org.jboss.msc.service.StartException in service jboss.deployment.unit."ejb31-timer.jar".component.SimpleScheduleSingletonTimerBean.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:1142) [rt.jar:1.8.0_111]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_111]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_111]
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

Resolution

The problem will be solved in EAP 6.4 (CP14 or later).

Persistence is enabled by default if not disabled by annotation.
You might consider to disable it, the effect is that a calendar timer without persistence is not fetched later if the event was missed during the downtime.

As a workaround the persistence can be deleted.
By default the server store the date in the filesystem $JBOSS/standalone/data/timer-service-data
each EJB will have a subdirectory with the application, module and bean name. The directory contains a file named with UUID for each persistent timer installed by this bean.

You can remove the complete directory if you have only declared calendar timers, existing timers with declaration will be re-installed.
If not you need to move each file, as the file is a serialized CalendarTimerEntity class, until you found the one which cause the failure.

Root Cause

The issue is tracked by This content is not included.BZ 1413033

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.