Single Interval EJB 3.0 Timer in Stateless Session Bean does not invoke @Timeout callback method

Technote (troubleshooting)


While using IBM Rational Application Developer for WebSphere Software v7.5.2 with WebSphere Application Server v7.0.0.1, a Single Interval EJB 3.0 Timer in a Local Interface Stateless Session Bean does not invoke @Timeout callback method when it expires.



Defect APAR PK73068 is likely a component related to this issue.


// Example of a simple stateless session ejb 3.0 with Single Interval Timer

package ejbtm;

import java.util.Date;
import java.util.logging.Logger;

import javax.annotation.Resource;
import javax.ejb.Stateless;
import javax.ejb.Timeout;
import javax.ejb.Timer;
import javax.ejb.TimerService;

* Session Bean implementation class MyTimerEJB
public class MyTimerEJB implements MyTimer
* Default constructor.
public MyTimerEJB() {
// constructor stub
private static final Logger log = Logger.getLogger(MyTimerEJB.class.getName());

private static final String TM_NAME = "MyTestTimer";

TimerService timerService;

public void myTimeout(Timer timer)
// Why is it not called when MyTestTimer expires?
System.out.println("Timeout myTimeout() called");
System.out.println("... called at: " + new Date(System.currentTimeMillis()));"Timer fired: timer=" + timer.getInfo());

public void startTimer()
{"Start timer");"...but first Stop any timers");
// Create time expiring in 10 sec
long duration = 1000 * 10;

Timer timer = timerService.createTimer(duration, TM_NAME);
System.out.println("Created Timer at : " + new Date(System.currentTimeMillis()));"Timer created: timer=" + timer.getInfo());"TimeRemaining=" + timer.getTimeRemaining());"Next timeout=" + timer.getNextTimeout());


public void stopTimer()
{"Stop timer");

for (Object tm : timerService.getTimers()) {
Timer timer = (Timer)tm;"Cancel timer: timer=" + timer.getInfo());

public void printTimer()
{"Print timer");

for (Object tm : timerService.getTimers()) {
Timer timer = (Timer)tm;"timer=" + timer.getInfo());

Resolving the problem

Upgrade to WebSphere Application Server v7.0.0.3 for Rational Application Developer v7.5.x using the Installation Manager:Updater, resolved this problem.

Note: This Timer related APAR fix in WebSphere Application Server for single interval timers, along with other non-APAR defect fixes may have contributed to the resolution. If upgrading to the latest available WebSphere Application Server 7.0.0.x FixPack does not help, you may have a new issue and
IBM Support for WebSphere Application Server should be contacted.

Rate this page:

(0 users)Average rating

Add comments

Document information

More support for:

Rational Application Developer for WebSphere Software
EJB Development

Software version:

7.5, 7.5.1, 7.5.2

Operating system(s):

Linux, Windows

Reference #:


Modified date:


Translate my page

Machine Translation

Content navigation