Skip to Content
Former Member
Sep 07, 2012 at 09:27 AM

TimerService not available in start up hook ?


Hello there,

I want to start a timer during @AppStartup-method. This works fine, when netweaver runs with only one server process. When this applications runs at NetWeaver with 2 server processes, the following error occurs :

Caused by: Injection on field timerService of instance test25.TEST25StartupManagerBean@2feaab94 failed. Could not get a value to be injected from the factory.
... 48 more
Caused by: Path to object does not exist. First missing component is [test25.TEST25StartupManagerBean], the whole lookup name is [java:comp/env/test25.TEST25StartupManagerBean/timerService].


The code:

public class TEST25StartupManagerBean implements TEST25StartupManagerLocal,Serializable {

private static final long serialVersionUID = 4012066785128839109L;


private TimerService timerService;

private Location loc;

public TEST25StartupManagerBean() {

loc= Location.getLocation(this.getClass());



public void startupHook()


SimpleLogger.log(Severity.INFO, Category.APPLICATIONS, loc, "startupHook:01", "start timer ");

Long days = 1L;

if(days!=null && days>0 )


long DAYS_IN_MILLISECONDS = 1000 * 60 * 60 * 24 * days;

Timer t = timerService.createTimer(Calendar.getInstance().getTime(),DAYS_IN_MILLISECONDS, 1);




Obviously the timerservice isnt avaiable during AppStartup, but only when more than one server process exist. What is wrong ?

Thanks for help